0

I have a given below link,

http://pathname/Home/Welcome?ID=69#tab2

We can able to get the query string values(after ? sysmbol) from the above link.. It is possible, But i want to get the after '#' symbol values(tab2) from the above url.

Is it possible?

Manikandan Sethuraju
  • 2,873
  • 10
  • 29
  • 48
  • possible duplicate of [How to get the hashtag value and ampersand value of a url in Javascript?](http://stackoverflow.com/questions/11727360/how-to-get-the-hashtag-value-and-ampersand-value-of-a-url-in-javascript) – Quentin Aug 16 '12 at 14:09

2 Answers2

7

You can get it with this variable:

window.location.hash

Want to know when it changes?

window.onhashchange = function(){
   // it changed!
};

https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange

Rene Pot
  • 24,681
  • 7
  • 68
  • 92
1

window.location.hash and similar (someAnchor.href.hash etc).

A note on nomenclature. That isn't a query-string, the query string ends at the #, that's the fragment identifier.

Jon Hanna
  • 110,372
  • 10
  • 146
  • 251