JHtmlArea - 'this' is undefined in 'loaded' function

254 Views Asked by At

I'm using JHtmlArea in my page and want to add a callback function to be executed after the control has been loaded. The documentation here is quite explicit that inside the callback function, this should refer to the JHtmlArea object. However, I am finding that is is undefined.

This simple test code:

$('#NoteText').htmlarea({
    loaded: function(){
        alert(this);
    }
});

Alerts 'undefined'.

I'm using jHtmlArea v0.7.5, JQuery 1.11 and IE10.

How can I get a reference to the jHtmlArea in the loaded callback?

0

There are 0 best solutions below