Created
July 26, 2011 08:58
-
-
Save Stephanvs/1106323 to your computer and use it in GitHub Desktop.
Custom jQuery selector
This file contains 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
$.expr[':'].internal = function (obj, index, meta, stack) { | |
var $this = $(obj); | |
var url = $this.attr('href') || ''; | |
var isInternalLink; | |
// Check link | |
isInternalLink = url.substring(0, rootUrl.length) === rootUrl || (/[^\:]/).test(url); | |
// Ignore or Keep | |
return isInternalLink; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment