為什么我的結果顯示不出來呀?不彈出網頁。。代碼如下。。
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ? // 新窗口打開時彈出確認框,是否打開
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? function openWindow();
? ? {
? ? ? var openwin=confirm("是否打開新網址?");
? ? ? if(openwin==true)
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? ? {
? ? ? ? var openwindows=prompt("請輸入網址:","http://www.baidu.com/");
? ? ? ? if (openwindows!=null)
? ? ? ? {
? ? ? ? ? window.open(openwindows,'_blank','width=400px,heigth=500px,menubar=no,toolbar=no');
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? alert("再見!");
? ? ? ? }
? ? ? }
? ? ? else
? ? ? {
? ? ? ? ?alert("再見!");
? ? ? }
? ? ?}
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2017-01-23
? ? function openWindow() 后面不要加分號
2017-02-03
????我沒加分號呀 也不行