Urgently need help in javascript try...catch
Dear Gurus and members,
I am a javascript and programming newbie. How can I use javascript try ... catch to check for the existance of an exe file on user's computer? The basic idea of the script is as below:
Code:
function loadRecorder() {
try
(
//load exe file located on user's computer, fixed path
location.href = "file:///C:/Program Files/IEBAudioRecorder/AudioRecorder.exe";
}
catch
{
//display a message saying the program does not exist in user's computer
//request user to download from the server
location.href = "http://server:00/library/IEBAudioRecorder.exe";
}
}
I don't know what var should I add after catch( ) and have no idea whether will this method work. I really appreciate if someone could complete the script above and guide me, if the script above doesn't work. Looking forward to some reply soon.
Thanks in advance,
Janice