I want to redirect the user to the url "/some/link+with+garbage/". When I use window.location.href="/some/link+with+garbage/"
I'm redirected to "/some/link%2Bwith%2Bgarbage/" which fails.
Is there a way to prevent window.location.href from encoding the url?
If anyone runs into this issue, the problem is not with the encoding of the url but another problem in my code. I tried to read from the url after page load and failed to properly decode the url using decodeURIComponent(window.location.href).
Rookie mistake. Thanks for the help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With