Number sign (#) as href (Full Version)

All Forums >> [Web Development] >> General Web Development



Message


Mane -> Number sign (#) as href (5/2/2008 22:30:52)

I think I remember reading something about this but I can't find it now...
Is it acceptable to use the number/hash sign # in links that are only used to trigger javascript but should stay on the same page, or are there some accessibility problems etc? Is there some better alternative, for example not even including a href property?
When using the href=# method, the page scrolls back to the top. Is there a way to avoid this?

Thanks




rdouglass -> RE: Number sign (#) as href (5/4/2008 11:21:34)

For me, if all I want to do is trigger a JS, I do something like this:

<a href="javascript:functionName();">Click Me</a>

No # there. The href doesn't have to be a link specifically.

Hope it helps.




Mane -> RE: Number sign (#) as href (5/6/2008 18:33:03)

Oh, that seems simple. Thanks!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875