Software Archive
Read-only legacy content
17060 Discussions

Application Error on seperate html pages

Zack_S_
Beginner
714 Views

Good day,

I have a problem with starting new pages. This seems to have appeared after the latest upgrade to Intel XDk. 1826. I typically have a normal App Framework application and I then add addition pages. My pages are separate html pages. In my example I have the normal generated index.html page then I also have a login.html page. I have tried starting the page with both javascript button: window.location.href = 'login.html'; and with html button: <input type=button onClick="location.href='login.html'" value='click here'>

In both cases I now get an Application Error.

When using App Preview, the error is: Application Error. There was a network error. (file:///data/data/com.intel.html5tools.apppreview/files/appmobicache/YqWWub....../4.0.0/login.html

When running as an installed app and I have tried on a second device the error is: Application Error. The web page contains an error. (file:///android_asset?www/login.html.

This however runs perfectly in the emulator

Please help how I can resolve this or what I should do differently. Also advise if more detail is required. This is crucial for me to resolve urgently.

Kind regards

Zack

0 Kudos
1 Solution
John_H_Intel2
Employee
714 Views

Try including both pages in a single index.html page. Put each section in its own DIV. You can get into trouble having multiple html pages.

View solution in original post

0 Kudos
8 Replies
PaulF_IntelCorp
Employee
714 Views

My guess is you need to configure the domain whitelist on the Projects tab. You should list the domains that your app is allowed to access, or use * to denote all domains.

0 Kudos
Zack_S_
Beginner
714 Views

Hi Paul,

Thanks for that.

I have made the change as you suggested make the result is the same. I have even created a new project with two forms. An index.html and a login.html. With a button that loads the login.html from the index.html. I urgently need to find a workaround or different approach.

regards

Zack

 

0 Kudos
John_H_Intel2
Employee
715 Views

Try including both pages in a single index.html page. Put each section in its own DIV. You can get into trouble having multiple html pages.

0 Kudos
Zack_S_
Beginner
714 Views

Thank you for the responses,

John, your suggestion is noted. Please elaborate a little why you recommend this approach. i.e. to put all the different pages into a single index.html page, separating them with div's?

For the record, I have re-created the project in question, this time using the Jquery Mobile framework for the Index page and subsequent pages and it seems to work fine. 

I would appreciate some more information though, I certainly don't want to run into 'trouble' as John predicts :) after a couple of days of hard work and having then to redo it all!

Really appreciate your help.

regards

Zack

0 Kudos
John_H_Intel2
Employee
714 Views

The trouble I am referring to would be things like including or not including your *.js files on multiple pages. This will lead to lots of time trying to debug things. Also, including the cordova.js file multiple times would lead to it being initialized multiple times, which is baaaaddd :)

0 Kudos
Zack_S_
Beginner
714 Views

Good day all,

I trust that your next response should get me going...

I am now going with what is recommended namely a single index.html. I am however missing something with my first attempt;

I have successfully created different div's and use the forms, submit to server, etc. successfully. My actual application works as follows: My opening page contains a number rows and columns. Four rows with four columns each. Within each column I have a image button that runs a page with code (previous method) and now a separate panel with div data-role page. My issue now is that the div sections containing the pages displays at the bottom of the main screen in the emulator and not as separate pages.Please provide me with some guidance here or point me to a tutorial that contains an example.

I really appreciate this

rgs

Zack

0 Kudos
Zack_S_
Beginner
714 Views

I have managed to get this going by using the UI to create sub pages and inserting the code I want to execute between the div's of the generated page div. This works fine. What I do however find is an instability when switching between the code and design view, creating pages and inserting controls in design view as well as customizing code in code view. As an example, it has happened on view occasions that a 'phantom' header and footer is inserted that I cannot get rid of.

Otherwise all is well. If anyone has come across this phenomenon and found a solution, please share this with me.

Kind regards

Zack

0 Kudos
Zack_S_
Beginner
714 Views

Hi Guys,

After update 1878, I decided to recreate my application from scratch so I could get rid of the header corruption issue as well as my network issue presumably created by the multiple html pages. I therefor created the new app with a single index.html file with several sub pages. All of this worked pretty well up to now. All of a sudden my Application Error: There was a network error when I access the remote server PHP scripts, is back. I have no idea what I 'messed up' Once again this happens on the device only and works perfect in the simulator. I have tried selecting and de-selecting plugins but no success yet.

I would really appreciate some help here

kind regards

0 Kudos
Reply