Use javascript split('&')
on window.location.hash
to separate the key/value pairs, then split('=')
to separate key from value, check if key=='type'
.
getting the value from url using # from javascript
-
12-10-2022 - |
문제
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 #
올바른 솔루션이 없습니다
다른 팁
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.
제휴하지 않습니다 StackOverflow