100分+100元RMB求助?

asq985 2009-05-12 09:41:30
a.html
<html>
<head>
<script>
alert("a");
</script>
</head>

<body>
<iframe id="b1" src="b.html"> </iframe>
</body>
</html>

b.html
<html>
<head>
<script>
alert("b");
</script>
</head>

<body>
<a href="javascript:;" onclick="alert('link');">link </a>
<iframe id="c1" src="c.html"> </iframe>
</body>
</html>

c.html
<html>
<head>
<script>
alert("c");
</script>
</head>
</html>

用vs2008 webbrowser控件:


Dim a1 As IHTMLDocument2 = Webbrowser1.Document.Window.Document.DomDocument
a1.parentWindow.execScript("function alert(str){}", "javascript")

Dim a2 As IHTMLDocument2 = Webbrowser1.Document.Window.Frames(0).Document.DomDocument
a2.parentWindow.execScript("function alert(str){}", "javascript")

Dim a3 As IHTMLDocument2 = Webbrowser1.Document.Window.Frames(0).Frames(0).Document.DomDocument
a3.parentWindow.execScript("function alert(str){}", "javascript")





为什么a2没起到作用呢?也就是不能把b.html中的alert屏蔽,但如果点击b.html中的link应该有一个alert弹出,但没有,也就是说屏蔽掉了,但是没屏蔽掉alert('b')
首先感谢!!!
...全文
140 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
gyouyang 2009-05-12
  • 打赏
  • 举报
回复
板凳
wuhuwy 2009-05-12
  • 打赏
  • 举报
回复
帮顶,等待高手!
a854468521 2009-05-12
  • 打赏
  • 举报
回复
帮顶,节分。
asq985 2009-05-12
  • 打赏
  • 举报
回复
只要问题解决,100%有RMB
wangan2008 2009-05-12
  • 打赏
  • 举报
回复
lz,google查查多好~
我不懂电脑 2009-05-12
  • 打赏
  • 举报
回复
不会有RMB的
knightwayne 2009-05-12
  • 打赏
  • 举报
回复
看看这个http://www.dezai.cn/article_show.asp?ArticleID=14307
zzxap 2009-05-12
  • 打赏
  • 举报
回复
alert最后一个的
zzxap 2009-05-12
  • 打赏
  • 举报
回复
window.parent.frames[0].Document.
sweetwindows 2009-05-12
  • 打赏
  • 举报
回复
up
helinhai 2009-05-12
  • 打赏
  • 举报
回复
UP

16,722

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧