87,925
社区成员
发帖
与我相关
我的任务
分享
function init()
{
if( frame1.document.readyState == "complete" ){
frame1.document.onclick =aaa;
return;
}
window.setTimeout("init();",100);
}
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script language="javascript" type="text/jscript" src="Js/JScript.js"></script>
<script language="javascript">
</script>
</head>
<body>
<iframe id="frame1" >
</iframe>
</body>
<script language="jscript">
function init()
{
frame1.document.onclick =aaa
}
function aaa()
{alert("sub");}
function loadfunc()
{
document.getElementById("frame1").src="B.html";
// writeCookie("xxmainworld","")
}
loadfunc();
init();
</script>
</html>
<html>
<script lanuage="javascript">
window.onload=function(){
iframe1.document.onclick=test1;
};
function test1(){
alert( 1 );
}
</script>
<body>
<iframe id="iframe1" src="2.html"></iframe>
</body>
</html>