Skip to content

Instantly share code, notes, and snippets.

@badsyntax
Created April 27, 2010 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badsyntax/380912 to your computer and use it in GitHub Desktop.
Save badsyntax/380912 to your computer and use it in GitHub Desktop.
// ripped from http://is.gd/bK13R
$.fn._init = $.fn.init;
$.getLastSelector = function() {
return $.getLastSelector.lastSelector;
};
$.fn.init = function(selector, context) {
if (typeof selector === 'string') $.getLastSelector.lastSelector = selector;
return new $.fn._init(selector, context);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment