打開網(wǎng)頁總是顯示 網(wǎ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 flag = confirm("是否打開新網(wǎng)頁?");
? ? if(flag){
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ? var url = prompt("請輸入要打開的網(wǎng)址:","http://idcbgp.cn/");
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? window.open(url,'_blank','width=400,height=500,menubar=no,toolbar=no');
? ? }
? ? } ?
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
不是瀏覽器的問題,下載老師的參考代碼打開沒問題
2015-12-27
var url = prompt("請輸入要打開的網(wǎng)址:","http://idcbgp.cn/");里面地址中http后面冒號是中文,改成英文就可以了
2015-12-26
找到原因了,直接復(fù)制過來的“http://idcbgp.cn/”里面的冒號是中文的...