2013-05-20 81 views
2

我正在用jQuery手機制作一個網站,但我遇到了問題。jQuery手機下一頁不起作用

我的第一個網頁看起來是這樣的:

<div id="page"> 
<div data-role="header" data-position="fixed"> 
    <a href="registreren.html">Registreren</a> 
    <h1>Name</h1> 
</div> 

<div id="container"> 
    <form id="loginform" method="post"> 
     <input type="text" name="gebruikersnaam" placeholder="Gebruikersnaam"> 
     <input type="password" name="wachtwoord" placeholder="Wachtwoord"> 
     <input type="submit" data-theme="b" value="Inloggen"> 
    </form> 
</div> 

當我點擊鏈接我去的網頁,至今無問題上的標題。但是當我在那個頁面上時,他沒有做任何事情,例如我在那個頁面上有一個提醒,但他沒有顯示。當我登錄registreren.html而沒有第一頁時,他顯示警報,我做錯了什麼?

我希望有人能幫助我。

回答

3

爲了理解這種情況,您需要了解jQuery Mobile的工作原理。它使用ajax來加載其他頁面。

第一頁正常加載。它的HEAD和BODY被加載到DOM中,並且它們在那裏等待其他內容。當第二頁被加載時,只有它的BODY內容被加載到DOM中。

要了解更多信息,以及如何解決這個問題(解決方案和示例)看看我的其他答案:Why I have to put all the script to index.html in jquery mobile

相關問題