1 line
1.6 KiB
JSON
1 line
1.6 KiB
JSON
{"name":"context","type":"property","title":".context","deprecated":"1.10","removed":null,"desc":"The DOM node context originally passed to <code>jQuery()</code>; if none was passed then context will likely be the document.","categories":["internals","properties/jquery-object-instance-properties","version/1.3","deprecated/deprecated-1.10"],"entries":[{"return":"Element","signatures":{"added":"1.3"},"examples":{"desc":"Determine the exact context used.","code":"\n$( \"ul\" )\n .append( \"<li>\" + $( \"ul\" ).context + \"</li>\" )\n .append( \"<li>\" + $( \"ul\", document.body ).context.nodeName + \"</li>\" );\n","html":"\nContext: <ul></ul>\n"},"longdesc":"\n <p>The <code>.context</code> property was deprecated in jQuery 1.10 and is only maintained to the extent needed for supporting <code>.live()</code> in the jQuery Migrate plugin. It may be removed without notice in a future version.</p>\n <p>The <code>.live()</code> method for binding event handlers uses this property to determine the root element to use for its event delegation needs.</p>\n <p>The value of this property is typically equal to <code>document</code>, as this is the default context for jQuery objects if none is supplied. The context may differ if, for example, the object was created by searching within an <code><iframe></code> or XML document.</p>\n <p>Note that the context property may only apply to the elements originally selected by <code>jQuery()</code>, as it is possible for the user to add elements to the collection via methods such as <code>.add()</code> and these may have a different context.</p>\n "}]} |