找了不少方法,發現就這個方法簡單、直接、方便,直接推薦哦!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