10-17-2003, 10:05 AM
How do I check if a file is missing?
<a onclick && onfilemissing( alert('file not found') );">check file</a>
Not going to use it like this at all, but I thought it would be easier to understand if I explain it like this... ;)
10-17-2003, 10:15 AM
see this sample:
10-17-2003, 10:18 AM
Thats one way, but I was trying to accomplish a for that loop until a page can't be found.
Page1.htm -> find
Page2.htm -> find
Page3.htm -> find
Page4.htm -> not find, end loop
Had one idea, but I don't know if it would work in any way, it involved onerror...
10-17-2003, 10:42 AM
If it were images you can use the Image object and use onerror and onload handlers to check for their existence. Though you can use Image object for non-image files, it would always fire onerror event even if files exist.
10-17-2003, 10:48 AM
There isn't then a proper way to do it exept on images?
10-17-2003, 11:05 AM
There's a method to do it, but it's not worth the effort.
10-17-2003, 11:30 AM
As I said in my first post, you can do it via XMLHTTP. The question here is why do you want to do such a thing.