How can I include special characters in query strings?

后端 未结 7 995
日久生厌
日久生厌 2020-12-09 15:22

URL http://localhost/mysite/mypage?param=123 works fine. However, if I want to put some special characters in param, like ?, /

7条回答
  •  悲&欢浪女
    2020-12-09 15:50

    Easy way to pass QueryString value with special character using javascript:

    var newURL=encodeURIComponent(uri);
    window.location="/abc/abc?q="+newURL;
    

提交回复
热议问题