2012-03-11 25 views
0

我是新來的jQuery及其插件...並創建發出第一次......任何錯誤,請幫我改善...分頁中jquerymobile不能按預期工作

我使用jquerymobile爲我的網站。在我的網站上有,所以我想用分頁顯示我的結果導致大量的記錄,我用了一個搜索欄...

[jQuery Mobile的分頁插件。] [1]

但它不工作如預期。

在Android瀏覽器,它經過兩次Pages..and停止拖動Opera瀏覽器,當我跑的代碼瀏覽器掛起......

我不能夠趕上問題是否與我的代碼或有任何插件支持這些瀏覽器的問題...

請幫助我...瞭解這一點。如果你已經使用過這個插件。
任何幫助將不勝感激。當我們的HTML表單的名字就像
        HTTP發生
        此問題:?//abc/def.html search_form_id = 30 &關鍵字=牛仔&的submit_btn =搜索#/ mobile_app/search_action.html ?關鍵字=牛仔& search_form_id = 90 &的submit_btn =搜索&組= 1 & page_no = 1

        HTTP://abc/def.html search_form_id = 30 &關鍵字=牛仔布01 ?的submit_btn =搜索#/ mobile_app/search_action.html關鍵字=牛仔& search_form_id = 90 &的submit_btn =搜索&組= 1 & page_no = 2

        HTTP://abc/def.html search_form_id = 30 ?&關鍵字=牛仔&的submit_btn =搜索#/ mobile_app/search_action.html關鍵字=牛仔& search_form_id = 90 &的submit_btn =搜索&組= 1 & page_no = 3

        HTTP://abc/def.html ?變奏h_form_id = 30 &關鍵字=牛仔&的submit_btn =搜索#/ mobile_app/search_action.html?關鍵字=牛仔& search_form_id = 90 &的submit_btn =搜索&組= 1 & page_no = 4

       這些名稱僅是從不同的1參數是page_no並且這些url是動態生成的。 這是我的代碼。我使用perl語言。
     在這種情況下,我無法使用jquery mobile分頁插件。
        my $ current_page = $ form_data {page_no} || 1;
        my($ prev_p,$ next_p);
       如果($ CURRENT_PAGE> 1){
        $ prev_p = $ CURRENT_PAGE - 1;
       }
       其他{
        $ prev_p = $ CURRENT_PAGE;
       }
        $ next_p = $ CURRENT_PAGE + 1;
        < \ UL數據角色= 「分頁」> < \利類= 「UI-分頁-PREV」> < \ A HREF =「/ mobile_app/search_action.html?關鍵字= <%$關鍵字%> & search_form_id = 30 &的submit_btn =搜索&組= 1 & page_no = <%$ prev_p%> 「>後退\ </LI>
        < \利類=」 UI-分頁-下「> < \一個href =「/ mobile_app/search_action.html?keyword = <%$ keyword%> & search_form_id = 30 &的submit_btn =搜索&組= 1 & page_no = <%$ next_p%>「>下一頁</A> </LI>
        </ul>
        plz幫助現在...

+1

神聖的橢圓。你有什麼問題?你需要提供更多的細節,而不是「按預期工作」。 – Bojangles 2012-03-11 14:16:31

+0

基本上,我想知道爲什麼手機瀏覽器掛在當我在手機中運行代碼...而在桌面上它的工作很好...... – 2012-03-11 15:43:47

+0

「plz help now ...」真的嗎? kind'a粗魯不? – balexandre 2012-03-13 10:06:34

回答

1

你可能忘了clode標籤在上一個按鈕

<ul data-role="pagination"> 
     <li class="ui-pagination-prev"> 
      <a href="/mobile_app/search_action.html?keyword=<% $keyword %>&search_form_id=30&submit_btn=Search&set=1&page_no=<% $prev_p %>">Prev</a> 
     </li> 
     <li class="ui-pagination-next"> 
      <a href="/mobile_app/search_action.html?keyword=<% $keyword %>&search_form_id=30&submit_btn=Search&set=1&page_no=<% $next_p %>">Next</a> 
     </li> 
    </ul> 
1

我jQuery Mobile的文檔中找到this。在細節上,我將重點放在最後一段「在頁面之間傳遞參數」。

也許你的鏈接傳遞參數到下一頁,但jQuery的移動框架不喜歡這種方式