【javascript】ajax请求 编码问题导致的ie浏览器在输入中文文字后没有内容,而chrome正常搜到文字...

chrome :

IE:

var matchVal = encodeURIComponent($('.inp_match').val());  //  此时ie下就可以正常搜索到了


/order/edit.html?act=select&sname=%E5%9B%9B

如果前端和后端页面编码不一样的时候可以

jQuery(form).ajaxSubmit({ 
url: "ajax.aspx?a=memberlogin", 
type: "post", 
dataType: "json", 
contentType: "application/x-www-form-urlencoded; charset=utf-8", 
success: showLoginResponse 
}); 

转载于:https://www.cnblogs.com/positive/p/3951142.html

猜你喜欢

转载自blog.csdn.net/weixin_33907511/article/details/93495844