我對照別人的語句檢查,應(yīng)該是沒錯(cuò)的,符號應(yīng)該也是沒錯(cuò)的,但是點(diǎn)擊還是沒反應(yīng),還有哪里錯(cuò)了呢?
<!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 openNew = comfirm("是否在新窗口打開網(wǎng)址?");
? ? ? ? if (openNew == true) {
? ? ? ? ? ? var webURL = prompt("請輸入你想打開的網(wǎng)址","http://idcbgp.cn/");
? ? ? ? ? ? if (webURL != null) {
? ? ? ? ? ? ? ? window.open(webURL,"_blank","width=400,height=500,menubar=no,toolbar=no");
? ? ? ? ? ? } else {
? ? ? ? ? ? ? ? alert("Bye Bye!");
? ? ? ? ? ? }
? ? ? ? } else {
? ? ? ? ? ? alert("Bye Bye!");
? ? ? ? }
? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2017-03-20
單詞拼寫錯(cuò)誤: ? var openNew = comfirm("是否在新窗口打開網(wǎng)址?"); 中的comfirm 應(yīng)該改成confirm