2011-08-10 130 views
0

我有兩頁,第一種叫index.html並有一個登錄按鈕與此代碼更改頁面conexion.html問題URL jQuery Mobile的按鈕首頁

$('#page').live('pagecreate',function(event){ 
    $("#login").bind("click", function(event) { 
     $.mobile.changePage("conexion.html",{ transition: "flip"}); 
    }); 
}); 

的URL更改

http://localhost/mobile/olapromo/#/mobile/olapromo/conexion.html

在 「connexion.html」

我回電話 「的index.html」,此代碼:

<a href="index.html" data-icon="home" data-iconpos="notext" class="ui-btn-right jqm- home">Home</a> 

,當我的主屏幕按鈕點擊URL變化

http://localhost/mobile/olapromo/#/mobile/olapromo/index.html

,我無法訪問conexion.html更多

+0

如果您有多個問題,請發表兩個獨立的問題 –

+0

我有編輯 –

回答

0

你什麼意思,你可以再次訪問conexion.html?你的意思是當你點擊登錄按鈕什麼都沒有發生?

如果是這樣的話;

您正在使用的pagecreate處理程序在哪裏定義?它是在頁面中還是像在document.ready處理程序中?

考慮將.bind更改爲.live,看看是否有效。

+0

我把這個,但它不工作$(「A」)。住(「點擊」,函數(事件){$ 。 mobile.changePage(「index.php」,{transition:「flip」}); }); –

+0

你可以在jsfiddle.net上做一個例子嗎?您似乎無法提供有關「無法訪問」的更多信息。有沒有JavaScript錯誤?它說「錯誤加載頁面」?什麼都沒有發生?粉紅色的大象在你的屏幕上轉儲嗎?我什麼也沒得到。 – Jacob