Created
April 20, 2016 20:54
-
-
Save cloaked-ninja/2602c1b87eab6d818489c9c2847881ed to your computer and use it in GitHub Desktop.
check 404
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
UrlExists(sitename2, function(status) { | |
if (status === 200) { | |
// file was found | |
console.log('URL found successfully'); | |
} else if (status === 404) { | |
// 404 not found | |
console.log('not this tyme - ' + output); | |
//runs code to change the output (combined site name/variable) | |
//make this a while loop - checking that the site name doesn't work | |
for (var i = 0; i < 11; i++) { | |
//console.log(i); | |
var output = sitename.reverse().replace(/(^.*?\/)/g, '').reverse(); | |
console.log(output); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment