My UIWebview displays links that, when clicked, send JSON data. To show this data, I need to:
1) Detect when a link is clicked
2) Retrieve the JSON
To retrieve the JSON, I tried using
[webView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"];
which resulted in:
<pre style="word-wrap: break-word; white-space: pre-wrap;">{some JSON}</pre>
Unfortunately,
[webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName(\"pre\")"];
returned an empty object. Are there any other methods to retrieve my JSON?
Regarding detecting when a link is clicked (question 1), is there a UIWebView delegate method available for this purpose?