Created
May 31, 2012 20:11
-
-
Save jcromartie/2845902 to your computer and use it in GitHub Desktop.
$.fn.findNS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($) { | |
| // an extension to jQuery to allow "find" with XML namespaces | |
| $.fn.findNS = function(ns, selector) { | |
| var prefix = ns + ":"; | |
| return this.find(selector).filter(function(idx, el) { | |
| return el.nodeName.indexOf(prefix) == 0; | |
| }); | |
| } | |
| })(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment