[jQuery] Plugins and context
Is there a way for plugins to know the context of the jQuery object?<div>
</div><div>According to the jQuery Core docs, I can create a jQuery collection by passing in a selector and a context, and I should be able to retrieve the context from the object's context property, but it's not working within plugins.</div>
<div>
</div><div>For example, here's a simple plugin and some code to run it:</div><div>
</div><div>$.fn.myPlugin = function()</div><div>{</div><div> console.log('selector:', this.selector); // this works</div>
<div> console.log('context:', this.context); // this doesn't work</div><div>};</div><div>
</div><div>var foo = $('#foo');</div><div>$('p', foo).myPlugin();</div><div>
</div><div>Is the context property only available outside the scope of plugins?</div>
<div>
--
Hector
</div>