|
復(fù)制代碼 代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標(biāo)題文檔</title>
<meta http-equiv="refresh" content="3;URL=#" />
</head>
<script type="text/Javascript">
function change(){
var a = document.getElementById("iframea");
var b = document.getElementById("iframeb");
a.setAttribute("src","http://www.163.com");
b.setAttribute("src","http://www.sina.com");
}
</script>
<body>
<!--#include file="z.html" -->
<iframe id="iframea" src="http://www.baidu.com/" width="450" height="300"></iframe>
<iframe id="iframeb" src="http://www.g.cn/" width="450" height="300">></iframe>
</body>
</html>
被包含的文件代碼:
<a href="#" onclick="change()">其中內(nèi)容點擊鏈接更新兩個iframe</a><br />
JavaScript技術(shù):JS是否可以跨文件同時控制多個iframe頁面的應(yīng)用技巧,轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。