SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: alternative to <a href="#"
-
Apr 7, 2005, 10:45 #1
alternative to <a href="#"
Hi,
By using <a href="#" onclick="... the page jumps to the top. Does anybody know a good alternative?
OK, I could write the siteīs URL in the href attribute but that means the page reloads every time.
Isnīt there a Null link or something?
oerdec
-
Apr 7, 2005, 11:46 #2
- Join Date
- Sep 2004
- Location
- Kelowna, BC
- Posts
- 202
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<a href="#" onclick="window.open('params...'); return false;">
putting the "return false" in should make that not happen.
-
Apr 7, 2005, 11:50 #3
thanks, thatīs what I was searching for.
-
Apr 8, 2005, 02:19 #4
- Join Date
- Feb 2005
- Posts
- 602
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Not quite sure what you're asking for, but you could use:
<a href="javascript:void(0)" onclick="...">
to make it not go to the top.
-
Apr 8, 2005, 13:01 #5
- Join Date
- Sep 2002
- Location
- Bournemouth, South UK
- Posts
- 1,551
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
an anchor will validate without a href.
So you can just use <a onclick="function()">LiveScript: Putting the "Live" Back into JavaScript
if live output_as_javascript else output_as_html end if
-
Apr 8, 2005, 13:48 #6
really? thatīs new to me, thanks.
Bookmarks