是否采取的WebView HTML标签<对象&gt ;? [英] Does webview take HTML tag <object>?

查看:170
本文介绍了是否采取的WebView HTML标签<对象&gt ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过很多次,并尝试使用HTML标记<对象> ,但只是应用程序崩溃和消失

当我使用普通的HTML标签,如每次< HTML> <身体GT; < H1> < D​​IV> < TD> < TR方式> 等,这些可以直接显示没有任何错误

这一次我尝试嵌入<对象> 标签的WebView,它总是崩溃!
有谁谁知道如何code里面直接做到这一点?或者,只是web视图无法做到这一点?

这是我的code。


 字符串的html =
  < HTML和GT; +
  <身体GT;< H1>这是一个测试!< / H1>中+
  <对象的classid =clsid中:D27CDB6E-AE6D-11CF-96B8-444553540000codeBase的=的http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8 ,0,0,0'WIDTH =200HEIGHT =200>< /对象> +
  < PARAM NAME =质量值=高>中+
  < PARAM NAME ='allownetworking'值='内部'>中+
  < PARAM NAME =allowScriptAccess的价值='从来没有'>中+
  < PARAM NAME =电影 value='http://video.yutube.com/flv2.swf?i=20100129LqvamMPB&d=360.25&movie_stop=off&no_progressive=1&otag=1&sj=5&rel=1'>\" +
  < PARAM NAME ='的allowFullScreen'值='真'>中+
  &LT;嵌入src='http://video.yutube.com/flv2.swf?i=20100129LqvamMPB&amp;d=360.25&amp;movie_stop=off&amp;no_progressive=1&amp;otag=1&amp;sj=5&amp;rel=1' WIDTH =200HEIGHT =200质量='高'allownetworking =内部的AllowScriptAccess ='​​从不'的allowFullScreen ='真'型='应用程序/ x-冲击波闪光PLUGINSPAGE =HTTP:// WWW。 macromedia.com/go/getflashplayer'></embed> +
  &LT; /对象&gt; +
  &LT; /身体GT;&LT; / HTML&gt;中;mWebView.loadDataWithBaseURL(,HTML,text / html的,UTF-8,);


解决方案

您有一个&LT; object>标签和两个&LT; /对象>标记。第一&LT; / object>也得走了。

embed标记是不识别对象的标签浏览器。这些浏览器将会看到嵌入标记,并会尝试使用它。支持对象标签浏览器将使用对象,并忽略嵌入,只要嵌入是对象内。如果嵌入的是对象外,对象意识到浏览器可能会加载两个对象和嵌入标签。

I tried many times and try to use HTML tag <object>, but app just crash and disappear.

Each time when I use normal html tag such as <html>, <body>, <h1>, <div>, <td>, <tr> etc. Those can be shown directly without any error.

This time I try to embed an <object> tag to webview and it always crash! Does anyone who know how to do this directly inside code? OR, webview just cannot do this?

here is my code.


String html = 
  "<html>" +
  "<body><h1>This is a test !!</h1>" +
  "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='200' height='200'></object>" +
  "<param name='quality' value='high'>" +
  "<param name='allownetworking' value='internal'>" +
  "<param name='allowScriptAccess' value='never'>" +
  "<param name='movie' value='http://video.yutube.com/flv2.swf?i=20100129LqvamMPB&amp;d=360.25&amp;movie_stop=off&amp;no_progressive=1&amp;otag=1&amp;sj=5&amp;rel=1'>" +
  "<param name='allowFullScreen' value='true'>" +
  "<embed src='http://video.yutube.com/flv2.swf?i=20100129LqvamMPB&amp;d=360.25&amp;movie_stop=off&amp;no_progressive=1&amp;otag=1&amp;sj=5&amp;rel=1' width='200' height='200' quality='high' allownetworking='internal' allowscriptaccess='never' allowfullscreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>" +
  "</object>" +
  "</body></html>";

mWebView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");

解决方案

You have one <object> tag and two </object> tags. The first </object> has got to go.

The embed tag is for browsers that don't recognize the object tag. Those browsers will see the embed tag and will try to use it. Browsers that support the object tag will use the object and ignore the embed, as long as the embed is within the object. If the embed is outside the object, object aware browsers may load both the object and embed tags.

这篇关于是否采取的WebView HTML标签&lt;对象&gt ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆