我在Windows Phone 8中编写应用程序,并且我有网络浏览器控制。
Web浏览器控件在完成加载HTML时触发Load Completed事件。但是我有带有java脚本的HTML.And脚本在加载完成方法的一段时间后加载。我想把loder放在这个java脚本加载中。
我的C#代码是
string htmlString = "<!-- BEGIN FUSION TAG CODE - DO NOT EDIT! --><style type=\"text/css\">img{ width:60%;}</style> <div><div id=\"proactivechatcontainer51ujohwy0o\"></div><table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"90%\" style=\"FLOAT: left ;MARGIN-LEFT: 150px; MARGIN-TOP : 150px;\"><tr><td align=\"center\" id=\"swifttagcontainer51ujohwy0o\"><div style=\"display: inline;\" id=\"swifttagdatacontainer51ujohwy0o\"></div></td></table></div> <script type=\"text/javascript\">var swiftscriptelem51ujohwy0o=document.createElement(\"script\");swiftscriptelem51ujohwy0o.type=\"text/javascript\";var swiftrandom = Math.floor(Math.random()*1001); var swiftuniqueid = \"51ujohwy0o\"; var swifttagurl51ujohwy0o=\"http://support.coretalkgroup.com/visitor/index.php?/WhatsUpMobile/LiveChat/HTML/HTMLButton/cHJvbXB0dHlwZT1jaGF0JnVuaXF1ZWlkPTUxdWpvaHd5MG8mdmVyc2lvbj00LjUwLjE1ODEmcHJvZHVjdD1GdXNpb24mZmlsdGVyZGVwYXJ0bWVudGlkPTkmY3VzdG9tb25saW5lPWh0dHAlM0ElMkYlMkZzdXBwb3J0LmNvcmV0YWxrZ3JvdXAuY29tJTJGX19zd2lmdCUyRmZpbGVzJTJGZmlsZV8xdW5ucm1keXh1Z3RybWcucG5nJmN1c3RvbW9mZmxpbmU9aHR0cCUzQSUyRiUyRnN1cHBvcnQuY29yZXRhbGtncm91cC5jb20lMkZfX3N3aWZ0JTJGZmlsZXMlMkZmaWxlXzc2dnpiOHByOHRubWk4cy5wbmcmY3VzdG9tYXdheT1odHRwJTNBJTJGJTJGc3VwcG9ydC5jb3JldGFsa2dyb3VwLmNvbSUyRl9fc3dpZnQlMkZmaWxlcyUyRmZpbGVfMWk1cnBpbHE4aGt2YmlvLnBuZyZjdXN0b21iYWNrc2hvcnRseT0KZjlhOGZiYjdiZDNiY2I4MWRkMDg4MjZhMzIyZmI2NjkzZmI1MWRlMg==\";setTimeout(\"swiftscriptelem51ujohwy0o.src=swifttagurl51ujohwy0o;document.getElementById('swifttagcontainer51ujohwy0o').appendChild(swiftscriptelem51ujohwy0o);\",1);</script><!-- END FUSION TAG CODE - DO NOT EDIT! -->";
var htmlCode = HttpUtility.HtmlDecode(htmlString);
WebView1.IsScriptEnabled = true;
WebView1.NavigateToString(htmlString);
我该怎么办?
有什么想法吗?
答案 0 :(得分:0)
据我所知,你可以编写一个匿名函数,只要加载脚本就会启动它。
(function(){
//js is loaded
}());