為什么沒(méi)反應(yīng),哪里寫(xiě)錯(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 myWin = comfirm("是否打開(kāi)?");
? ? ? ? if(myWin==true){
? ? ? ? ? ? var myWeb=prompt("請(qǐng)輸入你的網(wǎng)址","http://idcbgp.cn/");
? ? ? ? ? ? window.open(myWeb,'_blank','width=400,height=500,toolbar=no,menubar=no');
? ? ? ? }
? ? ? ? else{
? ? ? ? ? ??
? ? ? ? }
? ? ? ??
? ? }
? ??
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2019-10-08
var myWin = comfirm("是否打開(kāi)?");
其中“comfirm”寫(xiě)錯(cuò)了
2019-10-08
大哥,mywin的后面那個(gè)是confirm,不是comfirm,然后再將else那一整段刪了,應(yīng)該就可以了