站长资源网络编程

JQUERY的AJAX请求缓存里的数据问题处理

整理:jimmy2026/8/4浏览2
简介参数type由get改成post添加参数cache并设置成false添加时间戳$.ajax({url: 'ios/index',cache: false,type: 'post',data: {timestamp: new Date().getTime()//params here},dataTyp
  1. 参数type由get改成post
  2. 添加参数cache并设置成false
  3. 添加时间戳
$.ajax({
  url: 'ios/index',
  cache: false,
  type: 'post',
  data: {
    timestamp: new Date().getTime()
    //params here
  },
  dataType: 'json'
}).done(function (data) {
  //codes here
});

是不是非常的简单呢,希望小伙伴们能够喜欢。