Capturing information from a UIWebView

I have an application UIWebViewin my application that parses HTML from a server and presents it. My task is that there is a checklist in this HTML, and I would like to fix that the user checks and cancels the same HTML the next time it loads.

In any case, to fix the click on the checkbox? Any ideas on how to do this?

Thanks in advance.

+4
source share
2 answers

This can be done using java script. It includes several steps.

  • Add a listener to the document for the event CheckboxStateChange.
  • - , . js.
  • iframe URL: myevent://checkbox?id:value
  • iframe , - shouldStartLoadWithRequest. URL . "myevent", URL, .
  • , , , javascript .
+1

html- - javaScript callBack chack

- (BOOL)webView:(CustomWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    return YES;
}
0

All Articles