UIWebView获取网页点击事件

//接收web事件

 

-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{

        if ([request.mainDocumentURL.relativePath isEqualToString:@"点击事件名"]) {

            return false;  //执行本地代码,返回false不让网页读取网络资源

        }

    return true;   //为yes加载内容,否则不

}

posted @ 2016-12-21 13:53  飘金  阅读(1229)  评论(0编辑  收藏  举报