<!DOCTYPE HTML><html>?<head>? <title> new document </title> ?? <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> ??? <script type="text/javascript"> ?? ??? ? // 新窗口打開時彈出確認框,是否打開? ? function openWindow(){? ? ? ? ?var mydialog=confirm("是否打開");? ? ? ? ?if(mydialog==true){? ? ? ? ? ? var https myhttp;? ? ? ? ? ? ? ? https = "http://idcbgp.cn";? ? ? ? ? ? ? ? myhttp=prompt("請輸入網(wǎng)址",https);? ? ? ? ? ? ? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/? ? ? ? ? ? ?if(myhttp!=null){? ? ? ? ? ? ? ? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。? ? ? ? ? ? ? ? ?window.open(myhttp,'_blank',? ? ? ? ? ? ? ? ?'width=400,height=500,? ? ? ? ? ? ? ? ?menubar=no,toolbar=no');? ? ? ? ? ? ?}else;? ? ? ? ?}else;? ? ? ? }? </script>??</head>??<body>? ?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />??</body></html>
為什么window.open打不開網(wǎng)頁?
qq_時光過客__0
2016-07-26 15:15:47