Skip to content

Instantly share code, notes, and snippets.

@Ikke
Created April 11, 2012 07:50
Show Gist options
  • Save Ikke/2357689 to your computer and use it in GitHub Desktop.
Save Ikke/2357689 to your computer and use it in GitHub Desktop.
Check if there are any relative urls
var checkForRelativeLinks = function() {
console.log("Checking for relative urls")
$('a').each(function () {
var url = $(this).attr('href');
if (url && url != "#" && url.substr(0, 7) != "http://" && url.substr(0, 11) != "javascript:") {
console.log(this);
}
});
}
setTimeout(checkForAbsoluteLinks, 2000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment