Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
In my search option I redirect my URL to
window.location = '/admin/#q='+value+'&type='+type;
Now I want to take the value of q & type from URL
P.s. due to my url-rewrite rule I can't use ? instead of #
Use javascript split('&') on window.location.hash to separate the key/value pairs, then split('=') to separate key from value, check if key=='type'.
split('&')
window.location.hash
split('=')
key=='type'
Add a comment
You can obtain and modify the value after the # via window.location.hash. Note that depending on the browser there may or may not be a leading # sign.
#
Required, but never shown
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.
Explore related questions
See similar questions with these tags.