Forum closed. New forum available at http://community.wymeditor.org/

Add image to editor when onclick is called.

Support forum for WYMeditor.

Add image to editor when onclick is called.

Postby depi on Sun Nov 18, 2007 6:54 pm

Hello,

I'm using WYMeditor with Ruby On Rails. I have very small knowledge of JS and its frameworks, nowadays there are so many of them that it is impossible to know all of them (Prototype, jQuery, Script.aculo.us,...).

I would like to use WYMeditor as I like the WYSIWYM theory and I would like to add feature that can insert an image to the WYMeditor's textarea. The only problem I have is that I can't figure out how to do a simple "onclick" action that inserts some HTML (certainly the <img> tag) to the editor.

Is there someone who could give me a hint how to do that?

I was trying something like this:
Code: Select all
$j('.wymeditor').html('<p>Hello, World.</p>')

which didn't work for me.
depi
 
Posts: 1
Joined: Sun Nov 18, 2007 6:42 pm

Postby rostr on Wed Dec 19, 2007 8:58 pm

Try something like this:

WYM_INSTANCES[0].xhtml()


I know that's not the right way to do it, but it worked for me.
rostr
 
Posts: 22
Joined: Sun Jun 17, 2007 8:21 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest