2017-04-13 30 views
-2

的jQuery:的jQuery的document.ready不wotking

<script type="application/javascript"> 
$(document).ready(function() { 
    alert('hello world'); 
} 
</script> 

我知道在這個功能上沒有錯字的錯誤。但是,當文件準備就緒時,它並沒有提醒我。您可以在http://newseinstein.com/Rwork/index.php/Lost/step_2上查詢實況,請幫助我,並對弱英語感到抱歉。

+2

錯字 - '}'的',而不是})'。 –

+0

}而不是}); – Felix

+0

爲了將來的參考,當JS代碼不符合您的期望時,請始終檢查控制檯是否有錯誤。在這種情況下,你會被告知有關錯字 –

回答

2

你缺少的)ready功能

<script type="application/javascript"> 
$(document).ready(function() { 
    alert('hello world'); 
}); 
</script> 
0

你的功能是不正確的。你忘了最後一個括號。

正確的是

<script type="application/javascript"> 
$(document).ready(function() { 
    alert('hello world'); 
}) 
</script> 

檢查