js編程問題,運行有誤
<!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 open = confirm("是否打開新網(wǎng)站?");
??? // 新窗口打開時彈出確認框,是否打開
??????? if(open==true)
??? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
??????? {
??????????? var url=prompt("輸入想打開的網(wǎng)站網(wǎng)址:","http://idcbgp.cn/");
??????????? if(url!=null)
??????????? {
??????????? window.open(url,"_blank",'windth=400px,height=500px,menubar=no,toolbar=no');
??????????? }
??????????? else
??????????? {alert("再見!");}
??????? }
??????? else
??????? {
??????????? document.write("謝謝,不打開");
??????? }
??? }
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? </script>
?</head>
?<body>
?? ?? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
?</body>
</html>
找不到這段代碼哪里有問題,打不開http://idcbgp.cn/,運行結果狀態(tài)欄是這個“http://idcbgp.cn/code/http%EF%BC%9A//idcbgp.cn/”
2017-04-06
?window.open(url,"_blank",'windth=400px,height=500px,menubar=no,toolbar=no');
windth也寫錯了,應該是width
2017-03-21
? ? var url=prompt("輸入想打開的網(wǎng)站網(wǎng)址:","http://idcbgp.cn/");
?http后面的冒號改成英文狀態(tài)下的 ?http://idcbgp.cn/
2017-03-21
var url=prompt("輸入想打開的網(wǎng)站網(wǎng)址:","http://idcbgp.cn/");
這里不要直接復制他給的網(wǎng)址,他那http:冒號是中文冒號,不行的,換這個http://idcbgp.cn/
2017-03-21
親,請仔細點看噢,
var url=prompt("輸入想打開的網(wǎng)站網(wǎng)址:","http://idcbgp.cn/");
http://idcbgp.cn/?(正確)
http://idcbgp.cn/?(錯誤)
用英文輸入法輸入,你沒發(fā)現(xiàn)你的(:)間距很大嘛