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

slycrel

macrumors newbie
Original poster
Jul 11, 2008
29
0
Hey, is there anyone who can help me a bit with web content via stringByEvaluatingJavaScriptFromString? I've not done any javascript previous to now. BUT! I have dabbled enough over the past few days to be able to fill in text to fields using this method as well as checking a checkbox. I would also like to click a "submit" button as well as return the HTML content for a page inside the UIWebView. I'm fairly certain that the submit is possible, I am less certain of the HTML gathering. Can anyone help me out or point me in the right direction?

Thanks in advance.
 
Well, it seems like cheating, but this works for submitting the form:

document.getElementById('Button1').click();

I never did have any luck with the submit() function.

So now I just need to figure out how to get the content back via javascript. Any takers?

Incidentally, I am thinking of writing up a class to allow for queuing a bunch of javascript calls in a web view and then waiting for the results. Would anyone else be interested in such a thing? Or is this just tricky for us non-javascript guys? =)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.