xmlhttprequest 28 29 check if file exists

Solutions on MaxInterview for xmlhttprequest 28 29 check if file exists by the best coders in the world

showing results for - "xmlhttprequest 28 29 check if file exists"
Taina
09 Mar 2020
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}