N
Nathan
I've been reading a bit about proper ways to use <a> tags to launch
javascript functions, but I'm still not clear on one issue.
I understand it is common to create a link in HTML such as
<a href="javascriptless.html">
then override the href in java by setting it to href='#', and setting
an onclick function. The problem I'm having is that when I click on the
# link, the browser scrolls to the top of the page. Is there a way to
get around this?
One workaround I found is to use a nonexistant anchor such as
href='#notonthepage'. Both Firefox and IE7 beta do not scroll in this
case. But it seems like a hack. Is there a better way to deal with
this?
Thanks,
Nathan
javascript functions, but I'm still not clear on one issue.
I understand it is common to create a link in HTML such as
<a href="javascriptless.html">
then override the href in java by setting it to href='#', and setting
an onclick function. The problem I'm having is that when I click on the
# link, the browser scrolls to the top of the page. Is there a way to
get around this?
One workaround I found is to use a nonexistant anchor such as
href='#notonthepage'. Both Firefox and IE7 beta do not scroll in this
case. But it seems like a hack. Is there a better way to deal with
this?
Thanks,
Nathan