[thelist] javascript/fer why?

.jeff jeff at members.evolt.org
Wed Feb 20 20:31:01 CST 2002


> From: Josué Figueira Machado
> > for good behavior (reading the article at the link
> > below), we'll let you off with time served.  *grin*
> >
> > Links & JavaScript Living Together in Harmony
> > http://evolt.org/article/thelist/17/20938/
> Ok, so:
> <a href="digitalio1.htm"
>  onclick="subWin('digitalio1.htm',500,375);
>           return false;"
> >your image and don't forget the alt text</a>

that's better, but still not quite there.  the only thing you're missing is
that you don't have to hardcode the link to the document in the function
call.  you can simply reference it with the "this" keyword and its "href"

<a href="digitalio1.htm"
 onclick="subWin(this.href, 500, 375);
          return false;"
>your image and don't forget the alt text</a>

now your maintenance is absolute minimum.

> Do I still have to read the article? ;-)

of course.  there's more you might learn from it.

run along,


jeff at members.evolt.org

More information about the thelist mailing list