這里是什么問題,誰能幫我找找看呢?
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ??
? ? // 新窗口打開時彈出確認框,是否打開
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? function openWindow(){
? ? ? ? var mywins=confirm("你想要點開這個網(wǎng)站鏈接嗎?");
? ? ? ? if(mywins==true)
? ? ? ? {var url=prompt("輸入你想輸入的網(wǎng)址","http://idcbgp.cn");}
? ? ? ? if(url!=null)
? ? ? ? {window.open(url,'width=400,height=500,menubar=no,toolbar=no');}
? ? ? ? else
? ? ? ? {alert('byebye!');}
? ? ? ? else
? ? ? ? {alert('byebye!');}
? ? ? ? }
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2016-01-20
中文標點的問題;
if-else嵌套的問題;
open參數(shù)的問題
function openWindow(){
? ?var mywins=confirm("你想要點開這個網(wǎng)站鏈接嗎?");
? ?if(mywins==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('byebye!');
? ? ? ?}
? ?}
? ?else{
? ? ? ?alert('byebye!');
? ?}
}