user1227928
user1227928

Reputation: 829

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.

Upvotes: 13

Views: 8132

Answers (1)

Dunkelstern
Dunkelstern

Reputation: 1624

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

Upvotes: 21

Related Questions