【发布时间】:2011-06-22 05:09:42
【问题描述】:
这是我的代码:
webBrowser1.ObjectForScripting = this;
string str =
"<html><head><script type=\"text/javascript\">" +
"var list = document.getElementsByTagName('abbr');" +
"len = list.length;" +
"for(i = 0;i < len;i++)" +
"{obj=list[i];obj.onclick=window.external.Test(this.id);}" +
"</script></head>" +
"<body>";
for (int i = 1000; i < 1100; i++)
{
str += "<abbr id=\'" + i.ToString() + "\'" +
">" + i.ToString() + " </abbr>";
}
str += "</body></html>";
webBrowser1.DocumentText = str;
谢谢
【问题讨论】:
标签: c# javascript webbrowser-control