Home  >  Article  >  Web Front-end  >  Some problems with window.onload event in chrome_javascript skills

Some problems with window.onload event in chrome_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:33:361586browse

Suppose we have a page like the following:

Copy code The code is as follows:











In IE and When running under FF, the true size of the image can be displayed, even if I do not display the width and height of the img. But under chrome, it displays 0.
But if you change the new init() after window.onload to
window.onload=init
or
window.onload=function(){new init(){}}
You can read the size of the image after it is loaded.
Please keep the following information when reprinting
Author: Beiyu (tw:@rehawk)
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn