jquery 在chrome、FireFox 都正常,但是在IE 下请求不带数据,网上胡乱搜一通,加个
crossDomain: true == !(document.all)
就莫名其妙地好了,暂且还没弄明白什么原因,日后有时间再研究!
IE真的是很闹心!
IE真的是很闹心!
IE真的是很闹心!
$.ajax({
url: 'http://dhudong.cztv.com/vote/getvote?vote_id='+vote_id,
dataType: "json",
async: true,
type: 'GET',
cache: false,
crossDomain: true == !(document.all),//我也不知道为什么,加了它就对了!
success: function(obj) {
// do something
}
});
本文介绍了一个关于jQuery AJAX请求在Internet Explorer浏览器中出现的跨域问题,并提供了一个简单有效的解决方案。通过设置crossDomain参数,成功解决了IE下AJAX请求不带数据的问题。
243

被折叠的 条评论
为什么被折叠?



