山月

失败

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

<html>
<head>
<title>JS window.open tester</title>
</head>

<script language="javascript">
function jsOpenWindow() {
        var iRand = Math.round(Math.random()*1000000);
        var sURL = "Blank.html?ID=" + iRand.toString();
        var sHandle = iRand.toString();

        var oWin;
        try {
            oWin = window.open(sURL, sHandle, "");
        } catch (e) {
            alert("error");
        }
}
</script>

<body>
<input type="button" value="Open new window with unique ID" onclick="jsOpenWindow()"/>
</body>
</html>

 

Blank.html:

<html>
<head>
    <title>Random Incident</title>
</head>
<body scroll="no">
    Random Incident
</body>
</html>

 

说明:blank.html不存在,在IE下先弹出错误框,再弹出error,而在FF下只提示找不到文件。

posted on 2010-12-30 14:02  山|月  阅读(728)  评论(0编辑  收藏  举报