pranavjayadev
pranavjayadev

Reputation: 929

Webview source code in blackberry10

Hi friends I am developing an application in Blackbery10 to parse the xml data in an html page. That the html is loaded in a webview and the html source contains some xml tags. Please help me to get the html source code of web view in blackberry10.

Upvotes: 0

Views: 515

Answers (2)

Josh Wilks
Josh Wilks

Reputation: 21

On the Webview you can use a function evaluateJavaScript (const QString &script, bb::cascades::JavaScriptWorld::Typeworld world) to execute a javascript function to get the text or xml you need. You should be able to evaluate the following expression:

return document.documentElement.innerHTML;

You can then retrieve the evaluated expression from the signal javaScriptResult

Upvotes: 2

Benoit
Benoit

Reputation: 1921

You cannot access the HTML of a WebView that was loaded from network

If you want an application highly based on HTML, you can have a look at WebWorks. If you still require the native framework, you have to request the content yourself, parse it, and then inject it into the webview.

Upvotes: 0

Related Questions