02-25-2011 09:27 AM
Sorry if the topic name is confusing (couldn't think of anything better). So here is my issue:
I have a test.html in my File.applicationDirectory which I am able to access using loadURL. My problem starts when I pass some parameters to it like this:
loadURL("app:\test.html?x=1&y=2");
Here in the QNXWebView I get that there is a "Network Problem". Any one aware of some tweak to get this working?
Thanks in advance.
02-25-2011 09:30 AM
There is not a web server on the PB, so loading a local file into the browser will not execute the same way if it was loaded from a web server. So unless you are taking the arguments and processing them via JavaScript, I am not certain that will work.
02-25-2011 09:36 AM
As John said, those parameters usually have to be interpreted by server-side code, of which in this case there is none. Or are you attempting to pull them out of the current location URL using JavaScript?
By the way, I don't think putting "app:" as the scheme works. See this post for previously accurate details (though they may have changed with the 0.9.3 release... I never retested).
02-25-2011 12:59 PM
Thanks for the replies. First of all to clarify I am not using app: as I mentioned but going by the work around which peter mentioned in some other thread.
Regarding the parameters, yes I intend javascript present in test.html to fetch them from the url and use accordingly. All I was expecting was that loadURL will just load test.html (which it does perfectly without the parameters) and rest will be handled by JS code in it. Also a similar scenario on my desktop works( with a url file file:\\\C:\test.html?x=1&y=2..)
02-25-2011 01:23 PM
One other, useless but important, comment: make sure you don't use backslashes in those paths. Even on Windows, backslashes are really required only for command-line use, and not always even then, while on pretty much everything else the backslash is not valid. Use forward slash whenever possible, to avoid troubles.
In your URL string above, you've actually got the text "app:" followed by a tab character (from the "\t"), followed by "est.html"...
02-25-2011 01:37 PM
Sorry for the typos. So this is the exactURL which went inside loadURL:
file:///accounts/1000/appdata/PBDemo.debug.testdmV