為啥一點(diǎn)反應(yīng)都沒有....
<!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 a=prompt("通過輸入對話框確定打開的網(wǎng)址","http://idcbgp.cn");
? ? ? if(a!=null)
? ? ? ? {
? ? ? ? ? window.open(a,"_black",'width=400px','height=500px','menubar=no','toolbar=no');
? ? ? ? }
? ? ? ? else{}
? ? ? ? ?}
? ? ? ?else{}
? ? ? ??
? ? }
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2018-10-19
這位慕友,你的這句話
var open=confirm("是否打開新窗口");
后面的符號寫成中狀態(tài)下的了,所以js腳本有錯,整個腳本都不能運(yùn)行,把那個分號改成英文狀態(tài)下的就行了!