We are still rookie developers in HTML5 Builder, creating a Server Mobile Application.

We would like to know how to open another page (page2.php) using javascript.

Basically, the user will fill in a form, when the 'Submit' button is clicked, a few basic checks are done in javascript (like to check if all fields are filled in) and if validation is successful, the app needs to load the next page.

The following code have been tried:

window.location = "page2.php";

window.open('page2.php','_parent');

Both of these work fine when the app is running in a browser on the pc, but it does not work on the deployed app on Android, which will be the end product. We also tested it on more than one device with different versions of Android, with same result.

Any help will be appreciated, thank you.

有帮助吗?

解决方案

If you are using client-side AJAX navigation, which is enabled by default in mobile pages, you can change page with this:

$.mobile.changePage("TargetPage.php");
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top