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?

1

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

2 Comments

Good thinking on the onhashchange event, though support isn't full IIRC. There's a jquery onhashchange plugin.
@ManikandanSethuraju awesome. Please mark the answer as best as soon as you can do it :)
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.