方法1:服务器端代码加入response.setHeader("Cache-Control", "no-cache, must-revalidate");
方法2:用JavaScript在Ajax提交的时候加入一个随机数作为URL中的一个参数。req.open(url + "&" + Math.random).
后来上网搜的解决方法,希望对大家有用.
BLUEIDEA有个简单的法子解决这个问题,简单有效.
receiveReq.open("get","content.xml");
//当请求状态改变时调用handleReceiveChat方法
receiveReq.onreadystatechange = handleReceiveChat;
receiveReq.setRequestHeader("If-Modified-Since","0"); //加这行,完美解决
receiveReq.send(null);
方法2:用JavaScript在Ajax提交的时候加入一个随机数作为URL中的一个参数。req.open(url + "&" + Math.random).
后来上网搜的解决方法,希望对大家有用.
BLUEIDEA有个简单的法子解决这个问题,简单有效.
receiveReq.open("get","content.xml");
//当请求状态改变时调用handleReceiveChat方法
receiveReq.onreadystatechange = handleReceiveChat;
receiveReq.setRequestHeader("If-Modified-Since","0"); //加这行,完美解决
receiveReq.send(null);