This project has moved and is read-only. For the latest updates, please go here.

Access function from outside element?

Nov 17, 2009 at 1:16 AM

Sample code:

$(function() {
            $("#form_showHTMLview_button").click(function() {


Basicly... what is XXXXXX?

How do I access the functions?


Thanks for a very neat plugin!


Mar 17, 2011 at 6:53 PM

I think what you should do is cast the textarea jQuery Object to being of type jHtmlArea Prototype. But i myself haven't completely figured out how to do that yet either.

Mar 17, 2011 at 7:09 PM
Edited Mar 17, 2011 at 8:28 PM

Works now! With a damn workaround. In the loaded method i define my own jQuery namespace and store the object in there using "this".

loaded: function() {
$.myCustomConfig = {jhtmlareaobject : this};

Then in an outside method i access that namespace and convert it to jHtmlArea:

$.myCustomConfig.jhtmlareaobject[typeof jHtmlArea] = jHtmlArea;
$.myCustomConfig.jhtmlareaobject.pasteHTML('this is just a test!');

Should work for you too.