Re: Interaction with web javascript & cocoa
Re: Interaction with web javascript & cocoa
- Subject: Re: Interaction with web javascript & cocoa
- From: Markus Spoettl <email@hidden>
- Date: Tue, 20 Jan 2009 23:27:44 +0100
On Jan 20, 2009, at 11:06 PM, Alex Mills wrote:
I have built a Javascript WYSIWYG editor. I want to build a WebKit
based cocoa app with buttons that can call a function from the
editor loaded in webkit. For example I want to have a button within
the Cocoa interface that calls the Javascript function 'makeBold()'
to make the selected text within the editor bold. If this is
possible I then want to save the editor generated html to string so
that I can store it within Core Data. I checked out the Apple Webkit
programming guide but it doesn't provide much.
Have a look at "Using JavaScript From Objective-C" in the WebKit
Objective-C Programming Guide:
<http://developer.apple.com/documentation/Cocoa/Conceptual/DisplayWebContent/Tasks/JavaScriptFromObjC.html#//apple_ref/doc/uid/30001214
>
What it explains is how you can evaluate any JavaScript code from your
app (which means calling functions too), you can also have JavaScript
functions call back into your own Objective-C code.
Regards
Markus
--
__________________________________________
Markus Spoettl
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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