找了不少方法,发现就这个方法简单、直接、方便,直接推荐哦!ajax
在汉字的位置加个保护措施:encodeURIComponent(parentid)url
举个栗子>>>spa
$.ajax({
url: 'url'+ encodeURIComponent("中文参数值"),
type: 'GET',
dataType: 'JSON',
timeout: 5000,
error: function() { alert('error msg'); },
success: function(resp) {
console.log(resp);code
}
});io