I need to check if a webview when completed loading has any content or not.
What I require is simple. Its a small webview strip at the bottom of my pages (like an advert
This is based on Jano's approach but should perform better:
NSString *script = @"document.getElementsByTagName('body')[0].innerHTML.length"; NSString *length = [self.webView stringByEvaluatingJavaScriptFromString:script]; if (length.integerValue > 0) { NSLog(@"not empty"); }