I have a function for an ajax post call that goes like this:
function submitForm()
{
$.ajax(
{
type:'POST',
url:'form.php',
data:$('#form').serialize(),
success:function(response)
{
/////////////
$.mobile.changePage('#page1', {
reloadPage: true
}, {
allowSamePageTranstion: true
}, {
transition: 'none'
});
return false;
/////////////
}
}
);
}
The code between the ///////////////’s is the one I am trying to use to navigate back to the main menu after a successful ajax form submit. I do know that it works as I’ve tried with an alert and I see that the data is stored in MySQL. But I cannot figure out how to redirect back to my main page. I also have href=”#page1″ in the submit button, but all I get is a blank page that says “undefined”.
on success function
write