how to display jquery page(inside a div) using javascript?

前端 未结 3 1013
伪装坚强ぢ
伪装坚强ぢ 2021-01-16 06:28

here is my problem, i call this method and what it does is

post some data on server using jQuery, i want to display page using result i recieve from server

m

3条回答
  •  误落风尘
    2021-01-16 07:04

    try this..

    function loginPostData(jsonRequest)
        {
            $.post("http://localhost:8080/edserve/MobileServlet", 
                    JSON.stringify( jsonRequest), 
                    function(data) 
                    {
                        var obj = JSON.stringify(data);
                        //var object = JSON.parse(json_text);
                        //alert(obj);
                        alert(obj);
                        if(data.status=="success")
                        {
                            $.mobile.changePage( "#mainMenu"); // main menu div id..
                        }
                        else
                        {
                            if(data.message=="user not verified")
                            {
                                //display verification page
                            }   
                            if(data.message=="no user exist with this usname")
                            {
                                //set focus to username
                                $("#username").focus();
                            }   
                        }   
                }, "json");
        }
    

提交回复
热议问题