Created
July 4, 2013 12:05
-
-
Save CezaryDanielNowak/5927112 to your computer and use it in GitHub Desktop.
link-avability-checker.js
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
$('body').find('a').each(function(){ | |
var dis = $(this); | |
$.ajax( dis.attr('href'), { | |
method:'GET', | |
beforeSend: function(){}, | |
crossDomain: true //remove X-Requested-With | |
}) | |
.complete(function(xhr){ | |
if(xhr.status < 200 || xhr.status >= 400) | |
console.log('link error', dis, xhr) | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment