2014-02-08 94 views
1

这是什么情况。试试下面这个例子:当ajax用Jquery完成加载所有图像时检测到

的index.html

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 
<script type="text/javascript"> 
    $(document).on("ready", function(){ 
     $(document).load("h.html", function(d){ 
      document.write(d); 
      alert("Done!"); 
     }) 
    }) 
</script> 

等多种文件:h.html

<img src="http://www.noao.edu/noao/staff/kolsen/images/M31.jpg" width="600"/> 

我要实现的是加载使用jQuery AJAX和图像..并检测所有图像何时完全异步加载。 SI固定,加载请求显示警告消息,但图像仍在加载。我想检测它何时完全充电。我该怎么做?

谢谢!

+0

看看这个:https://github.com/alexanderdickson/waitForImages也许就是你寻找什么。 – ninty9notout

+1

是否有理由不直接加载图像? – Will

回答

相关问题