Re: running javascript from obj-C
Re: running javascript from obj-C
- Subject: Re: running javascript from obj-C
- From: Jens Alfke <email@hidden>
- Date: Wed, 3 Mar 2010 08:47:37 -0800
On Mar 2, 2010, at 4:14 PM, Russell Gray wrote:
> And I was thinking of taking the approach, of feeding a javascript function to Safari:
>
> function hide_elements(id)
> {
> document.getElementById(id).style.display="none";
> }
You can do the same thing by calling the DOM API from Objective-C. WebFrame has an accessor to get the DOMDocument and you can then make the identical calls on that.
It's also possible to send JavaScript to a frame as a string, but that has more overhead since it has to be parsed and interpreted.
—Jens_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden