HtmlElement jsScript = HtmlPage.Document.CreateElement("script");
jsScript.SetAttribute("type", "text/javascript");
jsScript.SetAttribute("text", "function ReloadPage(){window.open(window.location);}");
HtmlPage.Document.Body.AppendChild(jsScript);
ScriptObject so = HtmlPage.Window.GetProperty("ReloadPage") as ScriptObject;
so.InvokeSelf();
本文介绍了一种通过JavaScript实现页面重载的方法。具体步骤包括创建一个script元素,并设置其类型为text/javascript,然后定义一个名为ReloadPage的函数,该函数通过window.open调用当前窗口的位置来实现页面的刷新。
110

被折叠的 条评论
为什么被折叠?



