jq ajax get中文参数请求
您可以使用encodeURIComponent()函数将中文参数编码,然后将其添加到URL中作为查询字符串。
例如:
var chineseParam = "中文参数";
var url = "http://example.com/api?param=" + encodeURIComponent(chineseParam);
$.ajax({
url: url,
method: "GET",
success: function(response) {
// 处理响应
},
error: function(error) {
// 处理错误
}
});
在服务器端,您需要解码查询字符串来获取中文参数的原始值。
原文地址: http://www.cveoy.top/t/topic/cG6F 著作权归作者所有。请勿转载和采集!