标签:js html javascript
父窗口demo
<html> <head></head> <script language="javascript"> function show(){ //如果当前页与被iframe的页面属于不同域,则调用失效 window.frames['myframe'].document.getElementsByClassName("titleLink").item(0).href = "javascript:;"; } </script> <body> <iframe name="myframe" onload="show()" width="100%" src="frame.html"> </body> </html>
<html> <head></head> <body> <iframe name="myframe" onload="show()" width="100%" src="frame.html"> <a href="http://google.com" class="titlelink">google</a> <a href="http://google.com" class="titlelink">google</a> <a href="http://google.com" class="titlelink">google</a> <a href="http://google.com" class="titlelink">google</a> <a href="http://google.com" class="titlelink">google</a> </body> </html>
标签:js html javascript
原文地址:http://blog.csdn.net/kaylio/article/details/46316395