javescript与框架的合用是怎么回事

来源:百度知道 编辑:UC知道 时间:2024/06/08 11:07:12

理论就不说了,给你个例子

<html>

<body>

<script>
function redirectFrame(){
document.getElementById('frame1').src="http://www.baidu.com";
document.getElementById('frame2').src="http://www.google.com";
}
</script>

<iframe name="frame1" id="frame1" src="http://www.google.com"></iframe>
<br>
<iframe name="frame2" id="frame2" src="http://www.baidu.com"></iframe>
</br>
<a href="#" onclick="redirectFrame();">Click to redirect frames.</a&