I'm trying to get hash fragment of URL loaded in UIWebView, I have tried different approaches it does not seem to work.
For example if the UIWebView is loaded with "http://www.mysite.com/home#main":
NSURL *url = [NSURL URLWithString:@"http://www.mysite.com/home#main"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
then I want to get the full url, but it only return "http://www.mysite.com/home" with 3 different approaches:
1:
NSString *currentURL = [webView.request.URL absoluteString];
2:
NSString *currentURL = [NSString stringWithFormat:@"%@",[[webView request] URL]];
3:
NSString *currentURL = [webView stringByEvaluatingJavaScriptFromString:@"window.location.hash"];
what am I missing