ajax請求同一個(gè)url地址時(shí),如果發(fā)現(xiàn)url地址沒有變而緩存里有就會直接去取值,不會再去請求服務(wù)器。這種情況會在不同的機(jī)器不同的IE上各有不同,解決的方式是在ajax請求的地址里加上一個(gè)隨機(jī)的參數(shù)例如(jQuery):
$.getJSON(path+"/library/structuresView.do?num=1&structCount="+customColumnNum*rowNum+"&datetime="+(new Date()).getTime(), "", function(json){alert(json)})
$.ajax({url: path+"/library/structuresPropertyPreview.do?fetch=all&random="+Math.random(),
type: 'GET',
success: function(data){alert(data)} });
只要ajax每次請求的地址不一樣就可以的。
原文地址:http://yaofeng911.javaeye.com/blog/379705
posted on 2009-06-03 10:33
周銳 閱讀(462)
評論(0) 編輯 收藏 所屬分類:
Ajax