<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='docs.xsl'?>
<docs>
<method cat='Core' type='Object' short='Extends the jQuery object itself.' name='$.extend'>
<desc>Extends the jQuery object itself. Can be used to add functions into
the jQuery namespace and to [[Plugins/Authoring|add plugin methods]] (plugins).</desc>
<params type='Object' name='prop'>
<desc>The object that will be merged into the jQuery object</desc>
</params>
<examples>
<desc>Adds two plugin methods.</desc>
<code>jQuery.fn.extend({
  check: function() {
    return this.each(function() { this.checked = true; });
  },
  uncheck: function() {
    return this.each(function() { this.checked = false; });
  }
});
$("input[@type=checkbox]").check();
$("input[@type=radio]").uncheck();</code>
</examples>
<examples>
<desc>Adds two functions into the jQuery namespace</desc>
<code>jQuery.extend({
  min: function(a, b) { return a &lt; b ? a : b; },
  max: function(a, b) { return a &gt; b ? a : b; }
});</code>
</examples>
</method><method cat='JavaScript' type='Object' short='Extend one object with one or more others, returning the original,
modified, object.' name='$.extend'>
<desc>Extend one object with one or more others, returning the original,
modified, object. This is a great utility for simple inheritance.</desc>
<params type='Object' name='target'>
<desc>The object to extend</desc>
</params>
<params type='Object' name='prop1'>
<desc>The object that will be merged into the first.</desc>
</params>
<params type='Object' name='propN'>
<desc>(optional) More objects to merge into the first</desc>
</params>
<examples>
<desc>Merge settings and options, modifying settings</desc>
<code>var settings = { validate: false, limit: 5, name: "foo" };
var options = { validate: true, name: "bar" };
jQuery.extend(settings, options);</code>
<result>settings == { validate: true, limit: 5, name: "bar" }</result>
</examples>
<examples>
<desc>Merge defaults and options, without modifying the defaults</desc>
<code>var defaults = { validate: false, limit: 5, name: "foo" };
var options = { validate: true, name: "bar" };
var settings = jQuery.extend({}, defaults, options);</code>
<result>settings == { validate: true, limit: 5, name: "bar" }</result>
</examples>
</method></docs>
