Funkcja extend
rozszerza lub nadpisuje domyślne opcje wtyczki.1
jQuery.fn.foo = function(options) {
var defaults = {
length: 300,
index: 2,
text: "more"
};
var options = $.extend(defaults, options);
var txt = "length: " + options['length'] + "\n";
txt += "index: " + options['index'] + "\n";
txt += "text: " + options['text'] + "\n";
txt += "other: " + options['other'];
alert(txt);
};