window.open 子窗体的onload事件

下面的写法:
<script type="text/javascript">
function ops(){
var win = window.open('','_blank');
win.onload = function(){
alert('ok');
};
win.location.href = 'test.html';
}
</script>
</head>
<body>
<div class="bb" onclick="ops();">
圆角三边 这里是内容
</div>
</body>
火狐里面是可以alert的,但是ie8就不行。
解决办法是子窗体调父窗体的方法模拟回调。(IE真是让人纠结。)


Total views.

© 2013 - 2018. All rights reserved.

Powered by Hydejack v6.6.1