<!DOCTYPE html><html>?<head>? <title> new document </title> ?? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??? <script type="text/javascript"> ?? ? function openwindow(){? ? ? ? var open=confirm("您確定打開網址么?");? ? ? ? if(open==true){? ? ? ? ? ? var my=prompt("請輸入您想訪問的網址","http://www.baidu.com");? ? ? ? ? ? if(my!=null){? ? ? ? ? ? ? ? window.open(my,"_blank",'height=400px,width=500px,menubar=no,toolbar=no');? ? ? ? ? ? }? ? ? ? ? ? else{? ? ? ? ? ? ? ? alert("拜拜了您!");? ? ? ? ? ? }? ? ? ? }? ? ? ? else{? ? ? ? ? ?alert("拜拜了您!");?? ? ? ? }? </script>??</head>??<body>? ?<input type="button" value="新窗口打開網站" onclick="openWindow()" />??</body></html>
為什么打不開?
annynino
2015-10-30 16:36:53