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 -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -