誰能解答下為什么點擊沒有反應
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? <!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 url=prompt("請輸入網(wǎng)址","http://idcbgp.cn/");
? if(url!=null)
? {window.open(url,"_blank",'width=400px,height=400px,menubar=no,toolbar=no');
? }
? else{alert("再見");
? ? ??
? }
? }
? else{alert("再見");
? ? ??
? }
? ? ??
? }
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html> ?
??
2017-06-21
錯誤地方
2017-06-21
還有,你定義了兩遍html,把前6行刪了就好了
2017-06-21
<!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 url=prompt("請輸入網(wǎng)址","http://idcbgp.cn/");
? ? ? ? ? ? ? ? ? ? ? ? if(url!=null)
? ? ? ? ? ? ? ? ? ? ? ? {window.open(url,"_blank",'width=400px,height=400px,menubar=no,toolbar=no');
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? else{alert("再見");
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else{alert("再見");
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? </script>
</head>
<body>
<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
</body>
</html> ?
2017-06-21
你的請輸入網(wǎng)址后面的“逗號”,用的是中文輸入法