GET http://hong.dev.meituan.com/index.php?c=Search&a=associate&q=%20200 OK 24ms jquery-....min.js (第 4 行)参数头信息响应HTMLCookiesa associatec Searchq
This is the URL address of the Ajax GET request, why when the parameter q is Chinese, the parameter of Q under Firebug is empty? The address has the value Ah, I pass is the Chinese, why will give the code? In fact, this parameter is "milk"
Reply content:
GET http://hong.dev.meituan.com/index.php?c=Search&a=associate&q=%20200 OK 24ms jquery-....min.js (第 4 行)参数头信息响应HTMLCookiesa associatec Searchq
This is the URL address of the Ajax GET request, why when the parameter q is Chinese, the parameter of Q under Firebug is empty? The address has the value Ah, I pass is the Chinese, why will give the code? In fact, this parameter is "milk"
The address q=%20
is a space, so the following is also a space
So your server received a request in the parameter q is also a space, not Chinese奶
Let's make sure which link is out of the question.
I think what you need is a encodeuricomponent or encodeURI method to URL-encode the requested address. For details, please refer to
Encode-url-in-javascript