為什么我的網(wǎng)頁時(shí)打開了,但是提示說該頁面無法訪問?
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript">?
? ? ?// 新窗口打開時(shí)彈出確認(rèn)框,是否打開
? ? function openWindow(){
? ? ? ? var wopen=confirm("確定要打開新網(wǎng)站嗎");
? ? ? ? if(wopen==true)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? var winaddress;
? ? ?// 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? ? ? ? ? ? ? winaddress=prompt("請輸入你要打開的網(wǎng)址",""); ? ? ? ? ? ?
? ? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。 ? ? ? ? ? ?
? ? ? ? ? ? ?window.open('winaddress','_blank','width=400,height=500,menubar=no,toolbar=no');?
? ? ? ? ? ? } ? ? ?
? ? ? ? }
?
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2016-10-07
大兄弟,http后面的那個(gè)冒號是英文狀態(tài)下的才可以,你的是中文狀態(tài)下的,所以顯示不了。
2016-10-07
window.open('winaddress','_blank','width=400,height=500,menubar=no,toolbar=no'); ?這個(gè)地方,winaddress是變量,不需要有引號引起來的哦。你再試試