Home  >  Article  >  Web Front-end  >  Implementation code for JS file size judgment_image special effects

Implementation code for JS file size judgment_image special effects

WBOY
WBOYOriginal
2016-05-16 18:30:18930browse
Method one, use ActiveX control to implement:
Copy the code The code is as follows:






This method can be used in IE. If there are any shortcomings, there will be a security prompt. Changing the name to .hta will block the security prompts.
Method 2, use the dynsrc attribute of img:
Copy the code The code is as follows:






This method can be used in IE6, but cannot be used in IE7, IE8, Firefox, and chrome.
Method three, use the fileSize of img:
Copy the code The code is as follows:




< ;legend>Image source
LocalRemote:

Preview area





It can be used in IE, FireFox, and chrome, but it only determines the size of the image file.
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