達(dá)令說(shuō)
2018-12-07 04:45:07
在框架中點(diǎn)擊iframe1中的鏈接,要改變iframe2中的內(nèi)容!改怎么做?最好有代碼!
2 回答

桃花長(zhǎng)相依
TA貢獻(xiàn)1860條經(jīng)驗(yàn) 獲得超8個(gè)贊
a.html:
?
<html>
<body>
<script type="text/javascript">
function show()
{
alert(document.getElementById("frame2").src);
}
</script>
<iframe name="frame2" id="frame2" ?src="ab.html"></iframe>
<iframe name="frame3" id="frame3" ?src="axx.html"></iframe>
<button onclick="show()">測(cè)試</button>
</body>
</html>
<html>
<body>
<script type="text/javascript">
function show(){ alert(document.getElementById("frame2").src);}
</script>
<iframe name="frame2" id="frame2" ?src="ab.html"></iframe>
<iframe name="frame3" id="frame3" ?src="axx.html"></iframe>
<button onclick="show()">測(cè)試</button>
</body>
</html>
ab.html:
<html> <body> <script type="text/javascript"> function show() { alert(parent.document.getElementById("frame2").src); } </script> <button onclick="show()">測(cè)試</button> </body> </html>
- 2 回答
- 0 關(guān)注
- 396 瀏覽
添加回答
舉報(bào)
0/150
提交
取消