> I might have used the wrong terminology here so I will explain what I
> want to do. I am currently using the jquery.form plugin to make my
> forms 'ajaxable' where needed. However, I would like to add some extra
> functionality to the plugin which is specific to my application. In
> this circumstance is it better to write the functionality into the
> plugin directly or 'extend' it somehow? I say 'extend' when all I
> really need is to add some functions. Some forms won't need this extra
> functionality so extending it seems to me, to be the way forward.
>
> Would I use extend() to do this or is there some other syntactic sugar
> I can use?

I guess it depends what you want to change.  Using extend you can
redefine any of the public functions, but the private functions will
remain private.

$.extend($.fn, {
    ajaxSubmit: function(options) {
        // your code here
    }
});

The above it no different that just doing this

$.fn.ajaxSubmit = function(options) {
   // your code here
};


Mike

Reply via email to