這樣運行就沒問題了
function openWindow(); ? ?var bb,mymessage=confirm(“確定打開新窗口嗎”); ? ?if(mymessage==true) ? ?{ var bb=prompt("輸入網址:","www.xianlaiwan.cn/") ? ? ? ?window.open(bb,'_blank','width=400,height=500,menubar=no,toolbar=no, status=no,scrollbars=yes'); ? ?} }
2016-05-19
if(mysrte == true){var mewUrl=prompt("輸入網址",
"http://www.xianlaiwan.cn/")}
??? if(mewUrl!=null){window.open(mewUrl,"_blank","width=400,height=500,menubar=no,toolbar=no")}
??? }
2016-05-19
<!DOCTYPE?html> <html> ?<head> ??<title>?new?document?</title>?? ??<meta?charset="utf-8">??? ??<script?type="text/javascript">?? ????function?openWindow(){ ????var?message=confirm("是否打開新窗口"); ????if(message==true){ ????var?popen=prompt('輸入網址','http://www.xianlaiwan.cn/'); ????window.open(popen,'_blank','width=400,height=500,menubar=no,toolbar=no'); } } ??</script>? ?</head>? ?<body>? ??<input?type="button"?value="新窗口打開網站"?onclick="openWindow()"?/>? ?</body> </html>