1

Hi I would like to stop UIWebView from loading a specific image, the problem is that the images url changes, BUT its id (id="Header1_headerimg") stays the same.

The html on the web page:

< img alt="Equestria Daily" height="350px; " id="Header1_headerimg" src="http://4.bp.blogspot.com/-WS5XLbTi47E/ThdWHuLoR4I/AAAAAAAAHT8/cdqXIVfXB9k/s1600/newdefaultbannerappstra.png" style="display: block" width="1100px; ">

I want this blocked in UIWebView.

No I cannot edit the pages html.

Thank you.

DShah
  • 9,768
  • 11
  • 71
  • 127
Spazturtle
  • 23
  • 1
  • 4

1 Answers1

0

I think this would answer your question

[webview stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.getElementById('Header1_headerimg').style.display='none'"]];
Community
  • 1
  • 1
muymoo
  • 1,167
  • 2
  • 11
  • 16
  • Sorry if this seams like a stupid question but where would I put this? – Spazturtle Jul 12 '11 at 01:29
  • Right after you call `loadRequest:` [link](http://stackoverflow.com/questions/766627/uiwebview-stringbyevaluatingjavascriptfromstring-not-changing-text-box-value) – muymoo Jul 12 '11 at 21:49
  • You can find all the apps code at http://bottlelife.co.uk/app/ but the file I think needs editing is WebViewController.m found at http://bottlelife.co.uk/app/Classes/WebViewController.m – Spazturtle Jul 13 '11 at 14:32