1、在ie浏览器中,当请求为get请求的时候,只会发起一次请求,之后就不会再次新的请求,而是直接从缓存中读取数据。
2、解决方法 cache:false,(必要),应为ie浏览器默认是会缓存的(cache:true),post请求不会出现缓存数据问题。 或者在’/ajax/LuckyAward/get_user_luck_award_number?v=’+Math.random() 后面加上随机数或者时间错都可以。
3、下面是ajax请求的比较完整的写法:
var that=this,sendJson={ activity_id:that.acitve_id};
$.ajax({
url: “你的url地址?v=”+Math.random(),
type: 'GET',
cache:false,
data: sendJson,
dataType: 'json',
beforeSend: function (){},
success: function (json){
if (json.status != 1){
return false;
}
},
error: function (data) {},
complete: function (msg){},
})