|
okay strictly speaking, you would need to read the return headers to see if it's a 404 -- but I have no idea if Javascript allows you to read headers
there is a workaround however - you can create an xmlHTTPrequest object and use it to request a PHP code to run the file_exists function -- but this isn't very fast or efficient
you're better off checking for the problem using PHP while the page is still loading, as opposed to using Javscript
PS: I'm not a JS guru so wait for more replies before you decide
|