You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

XMLHttpRequest() enables you to check file availability by its methods: open, send and status.


fileexists = function(url)
{
    var http = new XMLHttpRequest();
    http.open('HEAD', url, false);
    http.send();
    return http.status!=404;
}
  • No labels