Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Highlighted
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Getting HTML from QNXStageWebView without URLLoader

Is there a way to get the raw HTML code (contents) of the current page in QNXStageWebView?  I know I can get the current URL and then use URLLoader to re-get the HTML code to process it, but since the HTML is already in the view, it would be great to just get a String back with the contents.  I did not see any obvious methods except the one where you can execute JavaScript on the view, but that did not seem to do the trick in calling "document.body.innerHTML".

Contributor
Posts: 30
Registered: ‎12-16-2010
My Device: Not Specified

Re: Getting HTML from QNXStageWebView without URLLoader

I just spent a whole day trying to do just that...nothing I tried worked, even injecting a JS function into the page and attempting to return the page html as a string.

 

Regular Contributor
Posts: 82
Registered: ‎11-12-2010
My Device: Android Droid Incredible
My Carrier: Verizion

Re: Getting HTML from QNXStageWebView without URLLoader

Do you have an example for how you executed the javascript (string)? Is it you pass the function name or the contents? I have tried both and gotten failure events with no supportive error.

Regular Contributor
Posts: 82
Registered: ‎11-12-2010
My Device: Android Droid Incredible
My Carrier: Verizion

Re: Getting HTML from QNXStageWebView without URLLoader

 

function updateKmlLayer(kmlUrl){
 ctaLayer = new google.maps.KmlLayer(kmlUrl);
 ctaLayer.setMap(map);
}

 

 

executeJavaScript("updateKmlLayer('" + GOOGLEKMZURL() + "')");

 

notice the single quotes between the parameter!