Identify submit button click of UIWebview

后端 未结 2 1251
一生所求
一生所求 2021-01-24 07:16

I have a UIWebView page with multiple button . Need to identify which button is clicked of the UIWebView.

Page source for UIWebview load contents:

2条回答
  •  清酒与你
    2021-01-24 07:55

    Do this with HTML Code

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:
        (NSURLRequest *)request navigationType: 
        (UIWebViewNavigationType)navigationType {
            if ([request.URL.scheme isEqualToString:@"inapp"]) {
                if ([request.URL.host isEqualToString:@"capture"]) {
                // do capture action
            }  
            return NO;
         }  
    
       return YES;
    }
    

提交回复
热议问题