Possible Duplicate:
how to display jquery page(inside a div) using javascript?
here is my javascript code
function loginPostData(jsonRequest)
{
alert("hello");
$.post("http://localhost:8080/edserve/MobileServlet",
JSON.stringify(jsonRequest),
function(data)
{
var obj = JSON.stringify(data);
alert(obj);
if(data.status=="success")
{
<!--problem lies here-->
$.mobile.changePage( "#mainMenu");
//$('#result').load('index.html#mainMenu');
// . load also give the same result
}
else
{
if(data.message=="user not verified")
{
//display verification page
}
}
}, "json");
}
PROBLEM: the jquery loads the main menu page, but nothing is displayed, untill i refresh the page
just a quick reference of my page
<div data-role="page" id="login">
// other page content
<div id="divrightButton">
<!-- calling loginSubmit which calls loginPostData method/function-->
<a class="bluebutton" href="#" onclick="loginSubmit(); return false;">Login</a>
</div>
</form>
</div>
<!--main page-->
<div data-role="page" id="mainMenu">
Main menu
</div>
i also came to know that there is some issue in jquery with same page transition
https://github.com/jquery/jquery-mobile/issues/2529
but how to fix these issue, i dont have any clue on this node
just in case, i have also tried the following for redirection/loading
$.mobile.changePage("#mainMenu",{allowSamePageTransition: true });
$('#result').load('index.html#mainMenu');
$.mobile.changePage( $("#mainMenu"));
none is working, what i mean is it works but results are same, nothing is displayed
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