How can I stop the browser from url-encoding form values on GET

前端 未结 6 1247
余生分开走
余生分开走 2020-11-29 09:20

I have a form with method=\"get\". In the form I need to pass the URL of a CSS file but it is encoding it to http%3A%2F%2Fwww... etc.

Is t

6条回答
  •  无人及你
    2020-11-29 10:06

    When you use FORM and GET method and some special chars, you will end up with browser encoding the resulted query. For newer browsers that support changing the URL address without refreshing the page (IE10+), is possible to decode the URL query string and update the address.

    I'm using a script like this:

        
    

    This will transform a http://example.com/page.html?path=foo%2Fbar back to http://example.com/page.html?path=foo/bar

提交回复
热议问题