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 and quick thing
loginSubmit() calls loginPostData ,loginSubmit make a json object and pass it to loginPostData
here is the piece of code from javascript
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")
{
//display main page
//$('#mainMenu').show(); <-- this does not give desired result
}
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");
}
and the page structure is like this
<div data-role="page" id="login">
// other page content
<div id="divrightButton">
<!-- calling loginSubmit which calls loginPostData-->
<a class="bluebutton" href="#" onclick="loginSubmit(); return false;">Login</a>
</div>
</form>
</div>
<!--main page-->
<div data-role="page" id="mainMenu">
Main menu
</div>
HOW TO SHOW MAIN MENU WHEN THERE IS SUCCESS,
the entire code of html is in single file in different div’s
use this code to redirect/display the particular div element
$.mobile.changePage("#mainMenu",{allowSamePageTransition: true });and also download following css file, its a must for transitioning between pages/div elements
jquery.mobile.transitions.css