I am trying this code but it gives me a DOM Exception. What I want it to get a true/false "answer" from the function using plain Javascript.
var url = 'http://www.google.com/';
function UrlExists(url)
{
var http = new XMLHttpRequest();
http.open('HEAD', url, false);
http.send();
return http.status!=404;
}
UrlExists(url);
I got this code from this SO answer, but as said I cannot get it working...