i am grateful that you have been able to contain the destructive power of
jquery with such little code



John Resig wrote:
> 
> Hi Everyone -
> 
> There's been some rabble-rousing concerning the destructive nature of
> jQuery (it's ok, rousing is a good thing ;-)). I claimed that it'd be
> easy to have it exist as a plugin. Well, it took me all of 10 minutes,
> but here it is:
> 
> jQuery.fn._pushStack = jQuery.fn.pushStack;
>               
> jQuery.fn.pushStack = function(){
>     var ret = jQuery.fn._pushStack.apply( jQuery(this), arguments );
>     ret.prevObject = this;
>     return ret;
> };
>               
> jQuery.fn.end = function(){
>     return this.prevObject || jQuery([]);
> };
> 
> You can see a demo (requires Firebug) here:
> http://john.jquery.com/jquery/test/destruct.html
> 
> So, if the destructive nature of jQuery bothers you - and you can't
> wait for jQuery 2.0, then just stick the above code in the header of
> your site (after jQuery) and you'll be good to go. Enjoy!
> 
> --John
> 
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Non-Destructive-jQuery-tf2482924.html#a6926106
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to