1function UrlExists(url)
2{
3 if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
4 var http=new XMLHttpRequest();
5 }
6 else {
7 var http=new ActiveXObject("Microsoft.XMLHTTP");
8 }
9
10 http.open('HEAD', url, false);
11 http.send();
12 return http.status!=404;
13}