Reputation: 39
I am using phonegap to write an application. I use jquery framework to combine different pages into one page. The problem occurs when I open the application and fill in the form, next page is shown.But it returns back to Index page quickly. Then I fill in the form again. The problem does not occur again. How can I fix the problem of returning back?
<input type="submit" onclick="location.href = '#page1'" value="Submit" />
Upvotes: 0
Views: 277
Reputation: 6060
You should use $.mobile.changePage('#page1');
from the jquery mobile framework
As stated in the documentation:
Programmatically change from one page to another. This method is used internally for the page loading and transitioning that occurs as a result of clicking a link or submitting a form, when those features are enabled.
http://jquerymobile.com/demos/1.2.1/docs/api/methods.html
Upvotes: 1