Quote:
Originally Posted by chuck
I have an app which has a UIWebView which is a quiz with dropdown boxes. At the bottom there is a button within the HTML which calls a JavaScript function to show which questions were answered correctly. At this point, I need to save the user's score. If all the questions are correct, I'd like to mark that that section is finished. Is there any way I could trigger an action from the UIWebView to the view controller when a user has answered all questions correctly? Any help would be greatly appreciated. Thanks!
|
In your JavaScript function call:
window.location = "MYDUMMYURL?";
Then in your webView's delegate implement the shouldStartLoadWithRequest method and then do whatever you need to and return NO if it's calling MYDUMMYURL.
- (BOOL)webView

UIWebView*)p_webView shouldStartLoadWithRequest

NSURLRequest*)p_reques t
navigationType

UIWebViewNavigationType)p_navigati onType