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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
Developer
jtegen
Posts: 6,149
Registered: ‎10-27-2010
My Carrier: AT&T

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".

Please use plain text.
Contributor
flashape
Posts: 30
Registered: ‎12-16-2010

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.

 

Please use plain text.
Regular Contributor
L7ColWinters
Posts: 82
Registered: ‎11-12-2010
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.

Please use plain text.
Regular Contributor
L7ColWinters
Posts: 82
Registered: ‎11-12-2010
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!

Please use plain text.