Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/410.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何知道在jquery';s.load()?_Javascript_Jquery_Html - Fatal编程技术网

Javascript 如何知道在jquery';s.load()?

Javascript 如何知道在jquery';s.load()?,javascript,jquery,html,Javascript,Jquery,Html,如果使用jquery的.load()加载包含图像的html片段,则调用回调时图像尚未加载。因为我需要根据图像的尺寸做一些计算,所以我需要知道它们实际上是什么时候加载的。有没有一个好方法可以做到这一点?imageElement.onload=callback

如果使用jquery的
.load()
加载包含图像的html片段,则调用回调时图像尚未加载。因为我需要根据图像的尺寸做一些计算,所以我需要知道它们实际上是什么时候加载的。有没有一个好方法可以做到这一点?

imageElement.onload=callback