為啥不能打開新網(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 kopen()
? {
????? var c=confirm("確認打開新網(wǎng)站");
????? if(c==ture))
?????? {
?????????? var d=prompt("請輸入你需要打開的網(wǎng)頁:","http://idcbgp.cn/");
?????????? if(d==null)
?????????? {
?????????????? document.write("真的不想打開么,再會!");
?????????? }
?????????? else
?????????? {
?????????????? window.open(d,'_blank','width=400,height=500,menubar=no,toolbar=no');
?????????? }
??? // 新窗口打開時彈出確認框,是否打開
?????? ?
??????? }
??????? else{
??????????? document.write("真的不想打開么,再會!");
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
??????? }
? }
?? ?
? ?
??? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
?? ?
?? ?
? </script>
?</head>
?<body>
?? ?? <input type="button" value="新窗口打開網(wǎng)站" onClick="kopen()"/>
?</body>
</html>
2018-07-17
if的)多打了一個,prompt是輸入框你后面已經(jīng)給定URL了
2018-07-09
2018-07-03
if c==ture))那里有兩個右括號
2018-06-28
http://idcbgp.cn/? 這個網(wǎng)址中的 : 是中文符號 不行??