View Full Version : Check if .js file exists

Mar 28th, 2007, 10:55 AM
I have a .js file that is called in to a page from a third party server as the data it provides is maintained by the third party.

I have been told that on some occasions this file may not be available and that i should have a 'dummy' set of data available locally to be inserted on the page if the .js file is not available.

It has to be handled client side so the first thing I thought of was to check if the file exists, if it doesn't, redirect to the other. I've asked around and checked on the internet and i've drawn the conclusion that this is not possible. Am I right to assume this cant be done? if so has anyone had this same problem and resolved it a different way?

Mar 28th, 2007, 11:09 AM
This has to be handled server side. It can't be done client side because Javascript has no file access whatsoever.