Skip to content

Instantly share code, notes, and snippets.

@Stephanvs
Created July 26, 2011 08:58
Show Gist options
  • Save Stephanvs/1106323 to your computer and use it in GitHub Desktop.
Save Stephanvs/1106323 to your computer and use it in GitHub Desktop.
Custom jQuery selector
$.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