views:

131

answers:

0

I'm currently developping a text-to-symbol conversion tool (non-profit), and I'm having this problem:

For the WYSIWYG-editting of the text, I'd like to use a nice small wysiwyg editor (like jHtmlArea). This editor will show floating divs, so I'll have to intercept a lot of keypresses (spaces/arrows/etc)

Currently, my html area is loaded like this:

<script type="text/javascript">    
$(function() {
            $("#txtCustomHtmlArea").htmlarea({
                 loaded: function() {
                 $(this.editor).keydown(function(event) { 
                     if(event.keyCode == 32) {
                         this.pasteHTML('<b>test</b>');
                         return false;
                     }

                     return true;
                });
            }

The problem with this code is that this.editor doesn't have the method pasteHTML. How can I use this method from this(=htmlarea).event?

This is most probably a fairly beginner question, but I'm really clueless towards where to look.

Thank you