Results 1 to 2 of 2

Thread: Urgently need help in javascript try...catch

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Posts
    79

    Question 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
    Last edited by janice_2k; Aug 25th, 2004 at 12:15 AM.

  2. #2
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    javascript cannot do this due to security issues, and thats a good thing.
    Have I helped you? Please Rate my posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width