相关疑难解决方法(0)

你什么时候应该使用escape而不是encodeURI/encodeURIComponent?

编码要发送到Web服务器的查询字符串时 - 何时使用escape()以及何时使用encodeURI()encodeURIComponent():

使用转义:

escape("% +&=");
Run Code Online (Sandbox Code Playgroud)

要么

使用encodeURI()/ encodeURIComponent()

encodeURI("http://www.google.com?var1=value1&var2=value2");

encodeURIComponent("var1=value1&var2=value2");
Run Code Online (Sandbox Code Playgroud)

javascript encoding query-string

1371
推荐指数
11
解决办法
45万
查看次数

标签 统计

encoding ×1

javascript ×1

query-string ×1