【问题标题】:Jquery mobile change window.location.href to mobile.changePageJquery 移动将 window.location.href 更改为 mobile.changePage
【发布时间】:2014-06-30 18:12:36
【问题描述】:

我有一个关于 JQuery mobile 的简短问题

我有以下脚本并希望有一个数据转换=幻灯片,但它不适用于 window.location.href。所以我想把它改成$.mobile.changePage。但我不明白。

这是脚本;

var category_data;
$(document).ready(function () {
    $('#search_category_form').bind('submit', function(){
        var form = $('#search_category_form');
        var data = form.serialize();

        $.post('index.html', data, function(){
            category_data = data; 
            window.location.href = 'index.html#search_general';
        });

        return false;
    });        

感谢您的帮助

【问题讨论】:

    标签: javascript jquery-mobile multipage


    【解决方案1】:

    $.mobile.changePage()is now deprecated,但是您可以将代码更改为:

    // [deprecated] $.mobile.changePage("index.html#search_general", {transition: "slide"});
    $.mobile.pageContainer.pagecontainer("change", "index.html#search_general", {transition: "slide"});
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-08
      相关资源
      最近更新 更多