Jquery mobile change page

前端 未结 6 1520
灰色年华
灰色年华 2020-12-14 07:38

I have two column layout for a webpage from the site, http://jquerymobile.com/demos/1.0.1/

Now they have provided provisions to changePage using

6条回答
  •  心在旅途
    2020-12-14 08:14

    function signin() {
    
        alert('singin button has been clicked');
        $.ajax({
            type: 'POST',
            url: 'http://localhost:8080/json/login',
            dataType: "json",
            headers: {'Authorization':'Basic '+ btoa('abc' + ':' + '12345')},
            contentType: 'application/json',
            data:loginFormToJSON(),
            success: function(data, textStatus, jqXHR)
            {
                if(data.token !="ErrorID-11000"){
                    alert('login successfully');
                    //document.location.href = "accountinfo.html";
                    //document.getElementById("loginBtn").replace="accountinfo.html";
                    $.mobile.changePage("accountinfo.html");
                }
    
                else{
                    alert('userid password did not match');
                }
            },
            error: function(jqXHR, textStatus, errorThrown){
                alert('login error:'+errorThrown + textStatus);
            }
        });
    
    }
    

    From the above code, I am in sign in page and going to accounts page on successful login, this is working with Jquery mobile 1.4.

    Hope that helps.

提交回复
热议问题