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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to