@DokSep 28.2006 — #I guees you could try and load the page in a frame/iframe and then check whether it indeed loaded. I would use server side scripting for this though...
@mrhooSep 28.2006 — #If you are using http and are checking on your own domain you can use
something like this: [CODE]function isFile(str){ var obj; if (window.XMLHttpRequest){//IE7 and everybody else obj= new XMLHttpRequest(); } else if (window.ActiveXObject) {//IE6 maybe try{ obj= new ActiveXObject('MSXML2.XMLHTTP.3.0'); } catch(er){ obj=false; } }
var O= obj; if(!O) return false; try{ O.open("HEAD", str, false); O.send(null); return (O.status==200) ? true : false; } catch(er){ // error handling return Yikes(er); } }[/CODE] If you are not opening a page using http; or it is on a different domain, you need to call a server script to test a file's existence.