Menu
Hi. I’m working on a project in javascript that launches pdf and doc files in a new browser window via hyperlinks. My problem is with verifying that the file exists. The files are on a CD, but I need to autodetect to see if the file opens properly in the new window. I’ve been using:
popup = window.open(url)
if(popup.location.href.indexOf(“error”) < 0)
popup.close();
alert(“…”);
}
which works great with the pdfs, but throws errors when the target url is a .doc file. Is there a way that I can tell if a .doc file has opened properly similar to how I’ve been verifying the pdfs?
Any help would be great.
thanks!