I am loading a url into a webview which has below HTML and javascript function call. Now I study, when the user touches the submit button in webview, he should call any method in viewController. Webview should load the url (web view delegate) - this is one approach, but is there any new way to find out when the javascript function is called by the web browser, should the view dispatcher inform or run any method in the view controller.
I am not looking for this solution that we need
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{ NSLog(@"passed data from web view : %@",[[request URL] query]); if([[[request URL] query] isEqualToString:@"clickedOnLineNo"]) {
We need to go to the fake url from your javascript method, e.g.
window.location = "someLink://yourApp/form_Submitted:param1:param2:param3";
by pressing a button or the desired action.
But are there any new JavaScriptCore features to achieve the same.
javascript ios objective-c ios7 javascriptcore
user3283486
source share