0

I have a panel with Id="panelbar" , and when I click on it, I have a function

$('#panelbar').bind('click', func1);

in func1(): I have this Code:

location.hash;

but , the code returns the previous hash, not new one. how can I get the new hash in each click?

Sara N
  • 1,079
  • 5
  • 17
  • 45
  • `location.hash` always returns the current hash (the one you see in the address bar), what do you mean it returns the previous one? – plalx Aug 07 '14 at 01:40
  • If location.hash return the previous hash its because you did not change it in the propper way. Can you write how are you changing the hash ? – levi Aug 07 '14 at 01:43
  • If you're binding the event listener to a anchor, it will take the the hash before it changes. If you want to get the hash from the anchor, you should get it by calling this ``$(this).attr('href')`` inside your function ``func1`` – João Mosmann Aug 07 '14 at 01:44

0 Answers0