這兒哪兒錯啦 為啥彈不出來網(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 mymessage=confirm("新窗口打開時確認(rèn)是否打開") // 新窗口打開時彈出確認(rèn)框,是否打開
??? if(mymessage=ture)// 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://yifanck.cn/
?? {window.open('http://yifanck.cn/','_blank','width=400,height=500','menubar=no','toolbar=no')//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。}
??? else
??? {
???????
??? }
}
? </script>
?</head>
?<body>
?? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
?</body>
</html>
2015-10-25
=是賦值的意思,==才是等于。
是true,不是ture。
這里的第3個參數(shù)列表中間不需要加引號。注釋不要把}給注釋掉
修改后的代碼你看看