Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
Feels like Im spamming the forum today, but I assure you that Im also looking for solutions by my own, and will always post any solution that I find. Promise :)

Anyway, how can I, by using stringByEvaluatingJavaScriptFromString, go trough a html-page and change the style of all the elements with, for instance, the name "myTable"?

I mean, how can I know how many of those elements there are on the html-page in question from the objc-environment? Or is my only option to make a large enough loop (which would slow down the app, though)?

Code:
[self.webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.getElementByName('myTable')[0-n].style.visibility='hidden';"]];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.