Pages

Thursday 3 December 2015

URL encode in javascript while redirection

I got the problem while i set location.pathname in javascript. I set path with some parameters like

location.pathname = "/friendship/show_info?name="tarun"

Javascript encode my url and conver "?" to "%03" something

/friendship/show_info%03name="tarun"

So I use location.replace() instead of location.pathname which creates a prefect route.


No comments:

Post a Comment