html anchor works only once -



html anchor works only once -

i ashamed have anchor issue.

so have code:

<a name="map"></a> $("div.store_list").click(function() { //do stuff location.href = location.href + '#map' });

when doing first click works fine. , url changes to:

http://mydomain.local/stores#map

second click url changes next , doesn't work:

http://mydomain.local/stores#map#map

any suggestions? thanks

try location.hash instead, e.g.

location.hash='#map'

html anchor

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -