我想,以显示我投入的iframe每个源的加载时间:有没有办法绕过JavaScript上的缓存?
$.get("text.txt", function (data) {
var array = data.split(/\r\n|\r|\n/)
var beforeLoad = (new Date()).getTime();
var loadTimes = [];
$('#1').on('load', function() {
loadTimes.push((new Date()).getTime());
$('#1').attr('src', array.pop());
$.each(loadTimes, function (index, value) {
var result = (value - beforeLoad)/1000;
$("#loadingtime" + index).html(result);
});
}).attr('src', array.pop());
});
有没有办法以某种方式让这个它难道不依赖于缓存?
使用适当的[缓存标题](http://stackoverflow.com/questions/1046966/whats-the-difference-between-cache-control-max-age-0-and-no-cache) – 2013-02-26 05:27:33
提示: ID不应该从数字开始。 '#1'不知何故不正确。阅读:https://developer.mozilla.org/en/docs/HTML/Global_attributes – diEcho 2013-02-26 05:29:37
到底什么是#1? – 2013-02-26 05:29:55