怎么看也看不出哪里錯了欸,為啥點按鈕沒反應呀
<!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 a=confirm("是否打開新窗口");
? ? if(a==true){
? ? ? ? var newweb=prompt("確認打開的網址:","http://www.xianlaiwan.cn");
? ? ? ? if(newweb!=null){
? ? ? ? ? ? ?window.open('http://www.xianlaiwan.cn','_blank','width=400,height=500,menubar=no,toolbar=no')
? ? ? ? }
? ? ? ? else{alert(2);}
? ? }
? ? else{alert(1);}
}? ?
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2019-03-18
<!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 a=confirm("是否打開新窗口");
? ? ? ? ? if(a==true){
? ? ? ? ? ? ? var newweb=prompt('確認打開的網址:','http://www.xianlaiwan.cn');
? ? ? ? ? ? ? if(newweb!=null){
? ? ? ? ? ? ? ? ? ?window.open('http://www.xianlaiwan.cn','_blank','width=400,height=500,menubar=no,toolbar=no')
? ? ? ? ? ? ? }
? ? ? ? ? ? ? else{
? ? ? ? ? ? ? ? alert(2);
? ? ? ? ? ? ? }
? ? ? ? ? }
? ? ? ? ? else{
? ? ? ? ? ? alert(5);
? ? ? ? ? }
? ? ? }? ?
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2019-03-17
2019-03-16
是window.open里面該寫雙引號嗎