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