為啥不能打開(kāi)新網(wǎng)頁(yè),哪里寫(xiě)錯(cuò)了么
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">
? function kopen()
? {
????? var c=confirm("確認(rèn)打開(kāi)新網(wǎng)站");
????? if(c==ture))
?????? {
?????????? var d=prompt("請(qǐng)輸入你需要打開(kāi)的網(wǎng)頁(yè):","http://yifanck.cn/");
?????????? if(d==null)
?????????? {
?????????????? document.write("真的不想打開(kāi)么,再會(huì)!");
?????????? }
?????????? else
?????????? {
?????????????? window.open(d,'_blank','width=400,height=500,menubar=no,toolbar=no');
?????????? }
??? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
?????? ?
??????? }
??????? else{
??????????? document.write("真的不想打開(kāi)么,再會(huì)!");
??? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
??????? }
? }
?? ?
? ?
??? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://yifanck.cn/
?? ?
?? ?
? </script>
?</head>
?<body>
?? ?? <input type="button" value="新窗口打開(kāi)網(wǎng)站" onClick="kopen()"/>
?</body>
</html>
2018-07-17
if的)多打了一個(gè),prompt是輸入框你后面已經(jīng)給定URL了
2018-07-09
2018-07-03
if c==ture))那里有兩個(gè)右括號(hào)
2018-06-28
http://yifanck.cn/? 這個(gè)網(wǎng)址中的 : 是中文符號(hào) 不行??