課程
/前端開發(fā)
/JavaScript
/JavaScript進階篇
為什么引入JS外部文件里的document.write("系好安全帶,準備啟航--目標JS")在后面寫上function...后,就不在右邊輸出了呢?有懂的人解釋下嗎
2016-07-19
源自:JavaScript進階篇 1-2
正在回答
document.write()后面要加分號
注意if else if 語法,只有if 后面加判斷條件,else后面永遠跟的都是判斷結(jié)果
kx00012kx 提問者
document.write("系好安全帶,準備啟航--目標JS");
function tan(){
? ? var txt=confirm("準備好了,起航吧!");
? ? if(txt==true){
? ? ? ? document.write("aaa") ? ? ? ? ? ? ? ?//少分號?document.write("aaa");
? ? }
? ? else(txt==false){ ? ? ? ? ? ? ? ? ? ? ? ? ? ? //(txt==false)應(yīng)該去掉
? ? ? ? document.write("bbb") ? ? ? ? ? ? ?//少分號?document.write("bbb");
? ??
function是函數(shù),不能引入外部函數(shù),只能引入外部文本或文本框!
document.write();,缺少了分號
交互是<form></form>,不加這個也可以,js中if要注意細節(jié),加“;”。
用 src引入了嗎
舉報
本課程從如何插入JS代碼開始,帶您進入網(wǎng)頁動態(tài)交互世界
2 回答外部文件js中寫上document.write
2 回答引用JS文件 document.write();不輸出
2 回答怎么引入JS外部文件。。。
3 回答關(guān)于ducument在js外部文件內(nèi)
4 回答將document.write寫在外部文件里會出現(xiàn)“document.write can be a form of eval.”這是什么意思?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-07-19
document.write()后面要加分號
注意if else if 語法,只有if 后面加判斷條件,else后面永遠跟的都是判斷結(jié)果
2016-07-19
document.write("系好安全帶,準備啟航--目標JS");
function tan(){
? ? var txt=confirm("準備好了,起航吧!");
? ? if(txt==true){
? ? ? ? document.write("aaa") ? ? ? ? ? ? ? ?//少分號?document.write("aaa");
? ? }
? ? else(txt==false){ ? ? ? ? ? ? ? ? ? ? ? ? ? ? //(txt==false)應(yīng)該去掉
? ? ? ? document.write("bbb") ? ? ? ? ? ? ?//少分號?document.write("bbb");
? ? }
? ??
? ??
? ? }
2016-07-19
function是函數(shù),不能引入外部函數(shù),只能引入外部文本或文本框!
2016-07-19
document.write();,缺少了分號
2016-07-19
交互是<form></form>,不加這個也可以,js中if要注意細節(jié),加“;”。
2016-07-19
用 src引入了嗎