請(qǐng)大家?guī)臀铱纯?,為什么提示網(wǎng)頁無法訪問,錯(cuò)誤代碼6
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script>
function open1(){
var a=confirm("是否打開");
if ?(a==true)
{
var b=prompt("請(qǐng)輸入網(wǎng)址","http://idcbgp.cn/")
if (b!=null)
{
window.open("http://idcbgp.cn/",'width=400','height=500','toolbox=no','menubar=no')
}
else alert("網(wǎng)址不得為空!")
} ? ?else alert("什么也沒有!")
}
// 新窗口打開時(shí)彈出確認(rèn)框,是否打開
// 通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
</script> ?
</head>
<body>
<input type="button" value="新窗口打開網(wǎng)站" onclick="open1()" >
</body>
</html>
2018-08-02
找到問題了,"請(qǐng)輸入網(wǎng)址","http://idcbgp.cn/")?中的冒號(hào)用的中文的冒號(hào),應(yīng)改為英文的。