kottke.org

...is a weblog about the liberal arts 2.0 edited by Jason Kottke since March 1998 (archives). You can read about me and kottke.org here. If you've got questions, concerns, or interesting links, send them along.

A short guide to doing

A short guide to doing JavaScript pop-up windows properly: specify your pop-up function in the href attribute instead of the onclick attribute. If you must use the onclick attribute, specify "javascript://" in the href attribute, not "#" because that will take you to the top of the page, a behavior which is not intended or appreciated by the Web user.

Preferred**: <a href="foo.html" onclick="window.open(this.href);return false;">
Good: <a href="javascript:PopUp()">link</a>
Good: <a href="javascript://" onclick="PopUp()">link</a>
Bad bad: <a href="#" onclick="PopUp()">link</a>

** Milo writes in with an even better method of doing pop-ups: <a href="foo.html" onclick="window.open(this.href);return false;">. Benefits include non-JS browser compatibility and shift/right click compatibility.

By Jason Kottke    Dec 27, 2001 at 09:12 am

kottke.org, quickly...

The best way to get a sense of what kottke.org is all about is to head to the front page or check out some random entries from the archives. Follow kottke.org via RSS or Twitter.

Want to share your something special with kottke.org's readers? Sponsor the RSS feed for a week!

Looking for work?

See more on the Job Board.

Recommended sites

David Archer    Matthew Paul Thomas    Rebecky    greg.org    jimr(ay)    evhead    panopticist    strange maps    Nivi    Type for you.    Airbag    Ikeepadiary    The Pop!Tech Blog    Eater    tremble.com    Frumination    Personism    NYT Science    Idle Words    The Laboratorium