哈哈,试了这么多还是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提交乱码的快速解决方法的详细内容。
