代碼練習問題
剛的帖子忘記放代碼了,麻煩大家幫我看問題,找了半天,不知道對不對,但點擊確定沒有跳轉到網址鏈接,也沒有挑出prompt的輸入框,謝謝!
<!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 newwid=confirm();
? ? ? ?if (newwid==true)?
? ? ? ?{ ??
? ? // 新窗口打開時彈出確認框,是否打開
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? ? ?var URL=http://www.xianlaiwan.cn
? ? ? ?prompt('請輸入網址',URL);
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? ? ?window.open('URL','_blank','width=400,height=500,menuboor=no,toolbor=no')
? ? ? ?}
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2018-06-20
confirm() ?括號中要寫上提示語