[thelist] Weird window targetting problem with javascript links

James Aylard evolt at pixelwright.com
Wed Jan 15 17:51:01 CST 2003


Erik Mattheis wrote:

> But let's back way up - why are you using JavaScript to open the
> window in the first place? And backing further up, why do you want to
> open the link in a new window?
>
> I'm waiting for .jeff to chime in here ...

    I'm not .jeff, but it is worth pointing out that Roger is using
javascript as a supplemental method to open the window. He also places the
url as the value of the href attribute, and has a target attribute
specified, as well.
    For the sake of simplicity, Roger, I would suggest an approach
publicized by .jeff here over the years: in the onclick event handler,
instead of reiterating the href and target, it is far preferable, imo, to do
it this way:

onclick="window.open(this.href,this.target);"

James Aylard
jaylard at members.evolt.org




More information about the thelist mailing list