幫我看下哪里出錯(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 mya=confirm("是否打開網(wǎng)站?");
??????? if(mya==true)
??????? {var url=prompt("打開的網(wǎng)址","http://idcbgp.cn/");
??? if(url !=null){
???????? window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no')}
??????? }
??????? {else
??????? alert("結(jié)束");}
?????? ?
???????? {else
??????? alert("結(jié)束");}
??? }
??? // 新窗口打開時(shí)彈出確認(rèn)框,是否打開
??? // 通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
?? ?
?? ?
? </script>
?</head>
?<body>
?? ?? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
?</body>
</html>
2016-06-10
else{} 語句錯(cuò)誤
2016-06-09
<script type="text/javascript"> ?? ?? ??
? ? function openWindow(){
? ? ? ? // 新窗口打開時(shí)彈出確認(rèn)框,是否打開
? ? ? ? var opens=confirm("是否打開新的網(wǎng)址")
? ? ? ? if(opens==true){
? ? // 通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? ? ? ? var ope=prompt("你要打開這個(gè)網(wǎng)站:","http://idcbgp.cn/")
? ? ? ? ? ? if(ope!=null){
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? ? ? ? ? ? ? window.open("http://idcbgp.cn","_blank","toolbar=no, menubar=no, scrollbars=yes, ?width=400, height=400");
? ? ? ? ? ? }else{}? ? ? ??
? ? ? ? }else{}
?? ? }
? </script>?
if ? else 語句要注意
2016-06-09
你的if_else語句格式錯(cuò)了,我調(diào)整了一下,可以使用。。。我也剛開始學(xué),一起加油。
2016-06-09
? ?{else
??????? alert("結(jié)束");}
?????? ?
???????? {else
??????? alert("結(jié)束");}
??? }這一段的括號(hào)不對(duì),是else{alert(“結(jié)束”);}
else{alert(“結(jié)束”);}