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