Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIWebViewNavigationTypeOther Vs UIWebViewNavigationTypeLinkClicked

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
//my code
}

Currently my above delegate method is called, once i touch inside in my webview.

So i want to know what is the difference between following 2 navigationtype: UIWebViewNavigationTypeOther & UIWebViewNavigationTypeLinkClicked.

Because some of the URL on selection provides navigation Type as UIWebViewNavigationTypeOther & some provide UIWebViewNavigationTypeLinkClicked.

From the apple document i cannot able to clear my self.

like image 342
user1227928 Avatar asked Apr 05 '12 13:04

user1227928


1 Answers

UIWebViewNavigationTypeLinkClicked happens if the user taps a <a href=""> style link, if the change is done from within Javascript (onclick event for example) UIWebViewNavigationTypeOther is used.

Furthermore UIWebViewNavigationTypeOther is used if you first load a page or you'll be redirected by a meta refresh or something

like image 150
Dunkelstern Avatar answered Sep 24 '22 22:09

Dunkelstern