<html>
<head>
<title>通过框架名引用框架</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
</head>
<body>
<iframe name="Frame1" width="300" height="200"> </iframe> <br><br>
<iframe name="Frame2" width="300" height="200"> </iframe> <br><br>
<script type="text/javascript" language="javascript">
<!--
window.Frame1.document.write("欢迎访问");
window.Frame2.document.write("www.groad.net");
-->
</script>
</body>
</html>
<html>
<head>
<title>frames[] 数组引用框架</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
</head>
<body>
<iframe name="Frame1" width="300" height="200"> </iframe> <br><br>
<iframe name="Frame2" width="300" height="200"> </iframe> <br><br>
<iframe name="Frame3" width="300" height="200"> </iframe> <br><br>
<iframe name="Frame4" width="300" height="200"> </iframe> <br><br>
<script type="text/javascript" language="javascript">
<!--
for (var i = 0; i < window.frames.length; i++)
window.frames[i].document.write("第", i+1, "个框架的内容");
-->
</script>
</body>
</html>
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |