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

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -