Skip to main content
Participating Frequently
November 30, 2011
Question

ios StageWebView LoadUrl with Query String Error

  • November 30, 2011
  • 2 replies
  • 2373 views

While I already have a workaround I would like to know if there are any better fixes for loading a html document with a query string into a StageWebView on ios.

Currently if I call the loadURL function with a url like "file:////index.html?test" the ? symbol gets change to %3f and the file does not load properly. The only fix I have found so far is to load the index.html file and then when the load complete event comes back to call loadURL again with a javascript call to fix the url such as

loadURL("javascript:window.location = 'file:////index.html?test';");

This in turn makes the webview reload as it should but this time with the query string in the location.

I am using Air 3.1, though I have noticed this error in past versions of air, this is just the first time I will need the functionality implemented in a project.

Thanks for your help,

Richard Pitul

This topic has been closed for replies.

2 replies

Participating Frequently
December 6, 2011

I had opened a bug on this issue when I encountered it.

https://bugbase.adobe.com/index.cfm?event=bug&id=3007603

Interesting enough, it was working back on AIR 2.7.  Adobe's Christophe Coenraets had used this technique in a blog post:

http://coenraets.org/blog/2011/07/flex-mobile-invoking-javascript-in-a-stagewebview/

Inspiring
November 30, 2011

Hi,

A more elegant solution maybe to instead reload the page, call a method in javascript that collects your queryString...

loadURL("javascript:parseQueryString('value=someVal&value2=someOtherValue')");

Anyway, you can use my StageWebViewBridge to do AS3 <-> JS <-> AS3 comunication if this can help...

http://code.google.com/p/stagewebviewbridge/