Home > Article > Web Front-end > A bug_javascript trick in ie handling the onload event of gif animation
If the src of the tag is a gif animation, then its onload event will be triggered repeatedly.
firefox does not have such a problem.
Solution:
<script> <BR>//by Go_Rush(阿舜) from http://ashun.cnblogs.com/ <BR>function gorush(obj){ <BR> alert("如果img的src为多帧gif动画,这个会重复弹出") <BR>} <BR></script>If src is set to static gif or jpg, bmp and other formats, it will not work This bug appears <script> <BR>//by Go_Rush(阿舜) from http://ashun.cnblogs.com/ <BR>function gorush(obj){ <BR> alert("这样,就只会弹出一次") <BR> obj.onload=null; <BR>} <BR></script>