Re: Image OnClick -> JScript -> CGI URL

by "Cyanide _7" <leo7278(at)>

 Date:  Fri, 18 Feb 2000 04:06:10 CST
 To:  gray_s(at)
 Cc:  hwg-languages(at)
  todo: View Thread, Original
the error you are recieving is more than likely due to a lack of quotes 
around the filename in the onClick event handler. the subject of what to 
place in the HREF is still a subject worth discussing. you have several 
options. first and formost, return false from the event handler so the link 
is never followed.  you can place "javascript:void(0)" in the href to do 
absolutely nothing where the *javascript* protocol is supported, or actually 
have a page load. possibly the very page js is to open, but with a _blank 
target. this would be quite practical in the event that js is disabled or 
not supported, your page will still function somewhat gracefully. all in 
all, i'd write the tag like so:

  onClick="Help('FF-t01-J9-000032-02.txt'); return false;"
  SRC="../help.jpg" BORDER="0"

good luck! - Cyanide_7

>Hi All,
>I have a page with an image, and I want to open a smaller window when that 
>  is clicked and have the results of a Perl script dumped to the new 
>The javascript assembles a URL pointing to the Perl script, and then opens 
>window with that URL.
>However, when I click on the image, I get an error.
>Here is the Javascript code:
><SCRIPT TYPE="text/javascript">
>function Help (filename){
>      myUrl = '/cgi-bin/'+filename+'&action=help';
>      Win1 = open
>             Win1.status = "Here is the Help File for this Job.";
>             window.close();
>and here is the call:
>I think the problem here is that the html code here is written into a frame 
>another perl script,
>so when I make the HREF point to "", it points to the cgi-bin directory, 
>and I
>get a server error
>saying that I can't execute a directory.
>Does anyone know where I should point the HREF or how else I could handle 
>If anyone could offer suggestions, I would appreciate it.

Get Your Private, Free Email at

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA