[thelist] onClick="open problem

Kelly Hallman khallman at wrack.org
Wed Feb 5 08:11:00 CST 2003


On Wed, 5 Feb 2003, Hugh Blair wrote:
> What drives me nuts is that I can't even call the html file with a
> direct link. Here it is:
> http://www.nanas-closet.com/cgi-bin/store/html/images/1014.html
>                /public_html/cgi-bin/store/html/images

As you suspected earlier, I think the problem may be in the fact that
you're trying to call an HTML file that is in a script directory.

It's highly likely that this directory is forcing a script handler.

> > I always call an included function as it's reused
>
> I would too, but I don't think it's possible to put it in the
> Perl template like this and get a dynamically generated line.
> What am I still missing?

As for your javascript, you should probably use
onclick="window.open(...); return false;"

instead of
onclick="open(...)"

It may be that Javascript is using the Window's open method implicitly
(when I look up open() in my Javascript book it says see Window.open()),
but it may be better to be more specific...

Returning false prevents the browser from also following the href.
Browsers may differ on this, but many execute the onclick handler first
and then follow the href as usual if the handler returns true (which it
would in your case, if the window opened successfully).

--
Kelly Hallman
http://wrack.org/







More information about the thelist mailing list