1:当用ajax无刷新加载img时,需要给img添加onload方法,如下所示:
<img src="" onload="javascript: loadImg(this);" />
<script language="javascript">
function loadImg(obj){
var img = new Image();
img.onload = function(){};//这里的function即使为空,也必须写上
img.src = obj.src;
}
</script>