javascript - Jquery mobile将window.location.href更改为mobile.changePage

标签 javascript jquery-mobile multipage

我有一个简短的问题要问 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;
    });        

感谢您的帮助

最佳答案

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

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

关于javascript - Jquery mobile将window.location.href更改为mobile.changePage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24496350/

相关文章:

javascript - 使用工厂的 Angular 服务,数据正确但未显示在 UI 上

android - Ajax 请求不适用于 cordova android 应用程序

.net - 将多页 TIFF 转换为 PNG .Net

javascript - "bwrap"未定义

javascript - 保存对 angularjs 中对象的响应

javascript - Bluebird promise 库 : are . map 和 .filter 并行运行?

javascript - 是否可以在非 jQuery Mobile 项目中使用 jQuery Mobile 中的特定内容?

android - 用于 Web 开发的廉价 Android 设备

excel - 如何动态获取当前多页tab值的值?

javascript - 选择一个项目或链接