Home  >  Article  >  Web Front-end  >  How jQuery counts the size of uploaded files_jquery

How jQuery counts the size of uploaded files_jquery

WBOY
WBOYOriginal
2016-05-16 16:18:131160browse

The example in this article describes how jQuery counts the size of uploaded files. Share it with everyone for your reference. The details are as follows:

For modern browsers (supporting html5), counting the size of uploaded files on the client can be achieved through $(selector)[0].files[0].size. However, in older versions of IE browsers, such as IE7, IE8 or IE9, this approach is not supported, but it can be achieved with the help of ActiveXObject objects.

Copy code The code is as follows:


@section scripts
{

}
Supplement:

To enable ActiveXObject in IE, proceed as follows:

→Tools

→Internet Options
→Safety
→Custom level, enable ActiveXObject

I hope this article will be helpful to everyone’s jQuery programming.

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