hi all,
i'm trying to create my first jQuery plugin. i got a prototype function called myListview and want to apply the plugin (named initLV) to it.
the function:
function myListview(div)
{
this.div = div;
$(this).initLV(); // apply the plugin
}
as you can see, i'm passing the whole prototype object to the plugin. my question: how can i access the object's div from inside the plugin? here's my plugin code - the 1st alert works, but all others dont :/
(function ($) {
$.fn.initLV = function ()
{
alert($("tr",this.div).length); // works
alert(this.div.html()); // don't work
alert($(this.div).html()); // don't work
alert($(this).div.html()); // don't work
}
})(jQuery);
it just makes no sense that the 1st alert works and the others don't. what could be wrong?
thx