View Single Post
Old 04-18-2007, 06:27 PM   #2 (permalink)
Stanley
 
Join Date: Jun 2006
Location: San Diego
Posts: 3,418
iTrader: 3 / 100%
Stanley Stanley Stanley Stanley Stanley Stanley Stanley Stanley Stanley Stanley Stanley
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
Stanley is offline