UIWebView獲取網頁點擊事件

//接收web事件web

 

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

        if ([request.mainDocumentURL.relativePath isEqualToString:@"點擊事件名"]) {spa

            return false;  //執行本地代碼,返回false不讓網頁讀取網絡資源事件

        }資源

    return true;   //爲yes加載內容,不然不it

}io

相關文章
相關標籤/搜索