krm
Posts: 0
Joined: Sat Jul 06, 2013 9:50 pm

Page navigation problem

I'm having a page navigation problem similar to that I've seen already mentioned. I created a simple app with two pages, containing navigation buttons to move between the two pages. It works fine in Test mode, and the apk binary works OK as well.

However, I exported the HTML/JS/CSS files but encountered a problem with navigation in the source. When I load either page in the browser, I cannot navigate to the other page using the button. It generates the alert "Error Loading Page." All files seem to be in the correct locations, including the screen_x.js files, and the the screen name variables in the js files seem to be correct. Can you suggest what I should look at? Thanks.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Page navigation problem

Hello - what code are you using on navigation buttons?
Try instead of opening a separate page to open an index.html

krm
Posts: 0
Joined: Sat Jul 06, 2013 9:50 pm

Page navigation problem

Thanks. I used Event-Navigate to page. I did try Event-Navigate to link, but it would not accept the file name (Screen1.html). It wanted me to enter a complete URL I believe.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Page navigation problem

For a "Navigate to Link" event - definitely will need an path URL

krm
Posts: 0
Joined: Sat Jul 06, 2013 9:50 pm

Page navigation problem

For that one would want to use a relative (not absolute) URL so the screen would load properly wherever the files are located, normally in the same directory. Is there a way to enter relative URL for Navigate to Link?

I do not understand why the HTML/JS/CSS files build to a working apk using Appery or PhoneGap Build, but those same source files don't work properly when loaded as native html in Chrome browser. I will try with a debugger turned on.

Thanks for your help.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Page navigation problem

Hi,

Such apps should be tested on server base. I.e. running index.html from Windows Explorer (or MacOSX Finder) is incorrect.

jQM tries to load other pages using AJAX. But Google Chrome security policy prohibits this for local files specified as the load target.

You would need to install and set up a local Web server application. For example Apache. This will allow you to test your application locally as a website.

krm
Posts: 0
Joined: Sat Jul 06, 2013 9:50 pm

Page navigation problem

Thank you. I had not tried putting it on the server -- just wanted quick local testing for compatibility and source editing outside Appery. I will check it out.

I did find another solution which works: turn on the "Render all pages in one HTML file" option in App Settings. That apparently forces Appery to keep all the pages in the single html doc; no AJAX required for moving between pages.

Return to “Issues”