大神幫忙看看哪錯了啊 一直找不到
<!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 what=confirm("是否打開?");
? ? ? ? ? ? if(what=true){
? ? ? ? ? ? ? ? var when=prompt("請輸入網(wǎng)址","http://idcbgp.cn");
? ? ? ? ? ? ? ? if(when!=null){
? ? ? ? ? ? ? ? ? ? window.open('http://idcbgp.cn','_blank','width=400,weight=500,menubar=no,toolbar=no');
? ? ? ? ? ? ? ? ? ? else{
? ? ? ? ? ? ? ? ? ? ? ? alert("謝謝!");
? ? ? ? ? ? ? ? ? ? ? ? else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? alert("謝謝!")
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
?
2018-07-29
你沒有發(fā)現(xiàn)你的if。。。else。。寫錯了嗎 ?else是必須喲啊配合if使用的,不能夠單獨使用,
2018-07-29
??????? function openWindow(){
?????? ??? ?var what=confirm("是否打開?");
??????????? if(what==true){
?????????? ??? ?var when=prompt("請輸入網(wǎng)址","http://idcbgp.cn");
???????????? if(when!=null){
??????????? ??? ?window.open(when,'_blank','width=400,weight=500,menubar=no,toolbar=no');}
??????????????? else{alert("謝謝!");}}
??????????????? else{
?????????????? ??? ?alert("謝謝!")}
????????????? }