Zdravim Vas, zaujimalo by ma ako overit existenciu url adresy napriklad (http://www.seznam.cz/) po zadani do formulara.
skusal som cez AJAX
function isThere(url) {
httpRequest= getRequest();
try {
var ux = url.substring(0,url.length-1);
httpRequest.open(\"HEAD\", url,true );
httpRequest.send(null);
if (httpRequest.readyState == 4 && httpRequest.status == 200) {
return true;
}
else{return false;}
}
catch (er) {
return false;
}
}
var httpRequest = null; //new XMLHttpRequest();
function getRequest(){
try {
httpRequest = new XMLHttpRequest();
}
catch (e) {
try {
httpRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");
}
catch (e) {
httpRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");
}
}
return httpRequest;
}
Avsak hodnotu true som naspat nedostal.... httpRequest.status je totiz vzdy rovny nule.