大神幫我看看哪里出錯了, 運行不了
<!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 myopen=confirm("是否新窗口打開網站");
??? // 新窗口打開時彈出確認框,是否打開
???
??? if(myopen==true)
??? {
??????? var myweb=prompt("請輸入你要打開的網址","http://www.xianlaiwan.cn/");
??????? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
??????? window.open(myweb,"_blank","width=400,height=500,menubar=no,toolbar=no");
??????? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
??? else
??? {
??????? alert("慕課網功能很強大,可以嘗試打開哦~http://www.xianlaiwan.cn/"}
???????
? </script>
?</head>
?<body>
?? <input type="button" value="新窗口打開網站" onclick="openWindow()" />
?</body>
</html>
2016-10-14
if結尾沒有花括號,else結尾也少一個function結束的花括號。
2016-10-14
少花括號
2016-10-14
你試著把window.open里面的""換成''試試看,然后刷新一下瀏覽器,我問題解決了
2016-10-14
我跟你好像是同一個問題,對了, window.open,括號里面的參數字符竄可以用""括起來嗎,不是要用''嗎