|
That last filter() example is a great candidate for a quick jQuery extension:
jQuery.fn.ns = function(namespaceURI) {
return $(this).filter(function() {
return this.namespaceURI == namespaceURI;
});
};
You can probably also do something involving extending the selector syntax, but that would probably be clunky, passing in URLs.
Check out the Plugin Authoring (http://docs.jquery.com/Plugins/Authoring) guide for more info. |