且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

不要在查询字符串 stringify 中编码 url

更新时间:2023-02-24 09:30:26

不是直接的,不是.虽然,如果您没有转义查询字符串中的值,那么使用查询字符串几乎没有任何好处.请记住:var q = 'url=http://domain.com'

Not directly, no. Although, if you are not escaping the value in the query string then there is hardly any benefit to using querystring at all. Mind as well just do: var q = 'url=http://domain.com'

从查看源代码来看,唯一的方法是更改​​(即覆盖)查询字符串转义()函数的行为 - 这是可能的,但不是一个好主意.

From looking at the source, the only way would be to change the behavior of (i.e. overwrite) the querystring escape() function - which is possible but not a good idea.