課程
/前端開發
/JavaScript
/JavaScript入門篇
實在是不曉得問題出在哪里,麻煩前輩們指導一下!
2018-11-09
源自:JavaScript入門篇 2-7
正在回答
第9行? new是特殊字符不能用作變量。
另外函數缺半邊大括號
慕瓜5039514 提問者
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ? function rec(){
? ? ? ? var,my message=confirm;
? ? ? ? if(mymessage="是否打開新網址?")
? ? ? ? {
? ? ? ? ? ? alert document.write("是否打開新網址?"+mymessage)
? ? ? ? ? ??
? ? ? ? }
? ? ? ? else {
? ? ? ? ? ? alert window.open(' http://www.xianlaiwan.cn','_black','width400px','hight500px','menubar=no','toolbar=no')
? ? }
? ? // 新窗口打開時彈出確認框,是否打開
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
function?openWindow()?{
你寫函數openWindow下面缺少‘}’。遇到問題一行一行的看,總能發現問題的。望采納,謝謝。
HungerCheung 回復 慕瓜5039514 提問者
舉報
JavaScript做為一名Web工程師的必備技術,本教程讓您快速入門
2 回答關于根據ID獲取元素的應用,希望前輩們指導下。
3 回答不太理解,希望有前輩指導一下關于變量賦值。
1 回答實在不知道哪錯了,檢查了好幾遍
6 回答本節課不明白關于運算的優先級問題,希望前輩和同學可以指導一下。
1 回答不知道哪里出了問題
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2018-11-13
第9行? new是特殊字符不能用作變量。
另外函數缺半邊大括號
2018-11-12
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ? function rec(){
? ? ? ? var,my message=confirm;
? ? ? ? if(mymessage="是否打開新網址?")
? ? ? ? {
? ? ? ? ? ? alert document.write("是否打開新網址?"+mymessage)
? ? ? ? ? ??
? ? ? ? }
? ? ? ? else {
? ? ? ? ? ? alert window.open(' http://www.xianlaiwan.cn','_black','width400px','hight500px','menubar=no','toolbar=no')
? ? ? ? }
? ? }
? ? // 新窗口打開時彈出確認框,是否打開
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2018-11-09
你寫函數openWindow下面缺少‘}’。遇到問題一行一行的看,總能發現問題的。望采納,謝謝。