2012-03-11 61 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的移动框架不喜欢这种方式