JP,在检查您的解决方案后,我仍然在 Firefox 中遇到问题,在加载页面之前它不会预加载图像。我通过sleep(5)在我的服务器端脚本中放入一些来发现这一点。我根据您的解决方案实施了以下解决方案,这似乎解决了这个问题。
基本上,我向您的 jQuery 预加载插件添加了一个回调,以便在所有图像正确加载后调用它。
// Helper function, used below.
// Usage: ['img1.jpg','img2.jpg'].remove('img1.jpg');
Array.prototype.remove = function(element) {
  for (var i = 0; i < this.length; i++) {
    if (this[i] == element) { this.splice(i,1); }
  }
};
// Usage: $(['img1.jpg','img2.jpg']).preloadImages(function(){ ... });
// Callback function gets called after all images are preloaded
$.fn.preloadImages = function(callback) {
  checklist = this.toArray();
  this.each(function() {
    $('<img>').attr({ src: this }).load(function() {
      checklist.remove($(this).attr('src'));
      if (checklist.length == 0) { callback(); }
    });
  });
};
出于兴趣,在我的上下文中,我使用它如下:
$.post('/submit_stuff', { id: 123 }, function(response) {
  $([response.imgsrc1, response.imgsrc2]).preloadImages(function(){
    // Update page with response data
  });
});
希望这可以帮助从 Google 访问此页面的人(就像我一样)寻找在 Ajax 调用中预加载图像的解决方案。