A short guide to doing JavaScript pop-up windows properly
by Volker Weber
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.
via kottke.org
Comments
Recent comments
Volker Weber
on BIS customers now getting instant IMAP e-mail at 10:38
Dirk Steins
on BIS customers now getting instant IMAP e-mail at 10:26
Yury Kats
on Site news: Chrome already accounts for almost 10% of page hits at 02:59
Volker Weber
on BIS customers now getting instant IMAP e-mail at 23:04
Stuart Mcintyre
on BIS customers now getting instant IMAP e-mail at 22:59
Volker Weber
on BIS customers now getting instant IMAP e-mail at 22:09
Jan-Piet Mens
on BIS customers now getting instant IMAP e-mail at 22:01
Ingo Seifert
on Nur bei Regen at 19:53
Dirk Steins
on Nur bei Regen at 09:01
Carl Tyler
on Everybody's PIN Number: Revealed! at 01:09
Armin Roth
on Everybody's PIN Number: Revealed! at 00:43
Frank L. Quednau
on Everybody's PIN Number: Revealed! at 23:42
Volker Weber
on Everybody's PIN Number: Revealed! at 22:00
Chris Linfoot
on Everybody's PIN Number: Revealed! at 21:57
Jan-Piet Mens
on Everybody's PIN Number: Revealed! at 21:39
Marco Klop
on Synchronizing iPhone with ... Lotus Notes at 18:55
sunny gerscky
on Pwnage 2.0 released at 16:00
Tobias Lange
on Remember, it's always the cable at 13:16
Volker Weber
on Remember, it's always the cable at 12:21
Ian White
on Remember, it's always the cable at 11:56
Andy Brunner
on Remember, it's always the cable at 11:37
Ben Rose
on Remember, it's always the cable at 11:33
Ben Poole
on It has only been less than two hours at 09:44
Frank L. Quednau
on It has only been less than two hours at 09:29
Martin Hiegl
on It has only been less than two hours at 08:27




Post a comment