您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

IE下Ajax提交乱码的快速解决方法

2024/3/25 17:40:24发布13次查看
下面我就为大家带来一篇ie下ajax提交乱码的快速解决方法。现在就分享给大家,也给大家做个参考。
哈哈,试了这么多还是encodeuricomponent管用啊!!!!
在汉字的位置加个保护措施:encodeuricomponent(parentid)
function loadcity(parentid) { var city = '${hotel.city}'; $.ajax({ url: './listcity.jspx?prov='+ encodeuricomponent(parentid), type: 'get', datatype: 'json', timeout: 5000, error: function() { alert('加载城市列表失败!'); }, success: function(msg) { $("#city").empty(); $.each(eval(msg), function(i, item) { if(item.city ==city){ $("<option value='" + item.city + "' selected = 'selected'>" + item.city + "</option>").appendto($("#city")); }else{ $("<option value='" + item.city + "'>" + item.city + "</option>").appendto($("#city")); } }); } }); }
上面是我整理给大家的,希望今后会对大家有帮助。
相关文章:
ajax表单异步上传文件实例代码
下拉菜单的级联操作
ajax实现省市区三级级联
以上就是ie下ajax提交乱码的快速解决方法的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product