I am creating a jQuery plugin and I am having trouble setting up the class/methods to fit the api access I would like.
Here is what I have so far, but it doesn't work (I get an Object doesn't support this property or method error):
(function( $ ){
$.kitty= function( name ) {
this.name = name;
this.cat= function( say ) {
alert( this.name + ": " + say );
}
};
})( jQuery );
I want to cause the output using:
$.kitty('chairman meow').cat('meow!');
output:
chairman meow: meow!