WebView加载网页时出现“Sorry,you browser seems not to support the HTML 5 canvas element ”
2013-01-06 10:37
501 查看
webView=(WebView)findViewById(R.id.webshow);
webView.loadUrl(urlString);
出错代码。
什么是 Canvas?
HTML5的canvas元素使用JavaScript在网页上绘制图像。
画布是一个矩形区域,您可以控制其每一像素。
canvas 拥有多种绘制路径、矩形、圆形、字符以及添加图像的方法。
如果您计划使用JavaScript将Web页面加载到WebView 中,您就必须为您的 WebView 启用JavaScript。一旦启用JavaScript,您就可以在您的应用程序与您的JavaScript代码之间建立接口。
默认情况下,在WebView中,JavaScript是禁用的。您可以通过将WebSettings附加到您的WebView中来启用JavaScript。你可以用getSettings()检索WebSettings,然后用setJavaScriptEnabled() 启动JavaScript。
webView=(WebView)findViewById(R.id.webshow);
WebSettings webSettings=webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.loadUrl(urlString);
webView.loadUrl(urlString);
出错代码。
什么是 Canvas?
HTML5的canvas元素使用JavaScript在网页上绘制图像。
画布是一个矩形区域,您可以控制其每一像素。
canvas 拥有多种绘制路径、矩形、圆形、字符以及添加图像的方法。
如果您计划使用JavaScript将Web页面加载到WebView 中,您就必须为您的 WebView 启用JavaScript。一旦启用JavaScript,您就可以在您的应用程序与您的JavaScript代码之间建立接口。
默认情况下,在WebView中,JavaScript是禁用的。您可以通过将WebSettings附加到您的WebView中来启用JavaScript。你可以用getSettings()检索WebSettings,然后用setJavaScriptEnabled() 启动JavaScript。
webView=(WebView)findViewById(R.id.webshow);
WebSettings webSettings=webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.loadUrl(urlString);
相关文章推荐
- Android - WebView 加载 Https 出现 SSL Error. Failed to validate the certificate chain
- IOS swift使用webView加载网页上传文件报错:whose view is not in the window hierarchy!
- Could not find the Visual SourceSafe Internet Web Service connection information for the specified database Would you like to launch the Visual sourceSafe connection wizard?
- webview加载网页出现白屏
- 解决Android Webview 加载一些网页出现白板现象
- This view is not constrained vertically: at runtime it will jump to the left unless you add a vertic
- TIP: when you get a message in job log user [Dr. Who] is not authorized to view the log
- 使用WebView加载数据出现找不到网页的问题之解决办法(转)
- Whoops! Sorry, but you are not allowed to perform the action requested.
- WebView加载HTML格式网页
- The web services enumeration components are not available,you need to reinstall Visual Studio to add
- php错误:访问网页出现Forbidden you donnot have permission to access … on this server
- iOS使用webView加载HTML网页链接简单展示
- iOS知识---webView加载网址报错Error Domain=NSURLErrorDomain Code=-1022 "The resource could not be loaded beca
- webview加载html格式的文本出现乱码
- AS- This view is not constrained vertically. At runtime it will jump to the left/(0,0) unless you
- 解决Android WebView中出现 Not allowed to load local resource:
- vs2013无法创建html,不能发布:The web publishing extension is not installed which is required to publish
- iOS 编译出现The file “xxx” couldn’t be opened because you don’t have permission to view it?