2016-05-30 137 views
1

$阿贾克斯({ 类型: “POST”, 异步:假, 网址:SerURL + “/登录”,

  1. 列表项

    dataType : "json", 
        contentType:"application/json", 
        data:JSON.stringify(data1), 
        success : function(data){ 
        console.log('success'); 
        console.log(data); 
        if(data.status=="20000"){ 
         $.mobile.changePage($("#page2")); 
        } 
        } 
    }); 
    

为什么$ .mobile.changePage()不能工作?

+0

当前的URL:http://本地主机:8080 /登录 changePage网址:HTTP://本地主机:8080 /第2页 但准备的URL:http://本地主机:8080 /登录/#/ 2页 所以不changePage至。 –

回答

0

$ .mobile.changePage从jQuery Mobile 1.4.0开始已弃用,并将在1.5.0中删除。

尝试使用pagecontainer widget的变化()方法:

$("body").pagecontainer("change", "page2", { options... }); 

我希望这可以帮助你!