Because I now get a feature is the upload when the large size of the image filter, so need to get the upload to choose the size of the image, so with this blog post
Not much to say on the code
$ (' input '). Change (function (e) {
1??、 console.log (e) What did ==> get?
Get: Here are the
- altkey:undefined
- Bubbles:true
- Cancelable:false
- Ctrlkey:undefined
- Currenttarget:input
- Data:null
- Delegatetarget:input
- Detail:undefined
- Eventphase:2
- Handleobj:Object
- isdefaultprevented:h ()
- jQuery22007808826687871413:true
- Metakey:undefined
- Originalevent:Event
- Relatedtarget:undefined
- Shiftkey:undefined
- Target:input
- TimeStamp:3956.0400000000004
- Type:"Change"
- View:undefined
- Which:undefined
- __proto__:Object
2??、 Console.log (e.target) What will you get?
The resulting input object <input type= "file" multiple= "multiple" style= "top:91px; left:44px; position:absolute; opacity:0; z index:1000; " >
3??、 Console.log (e.target.files), what do you get?
Get a bunch of filelist
- FileList
- Length:0
- __proto__:FileList
4??、 Console.log (E.target.files[0]) What can I get?
Get the first input to select the image of some parameters, the resulting parameters can be extracted according to their own needs, such as I now need is the size parameter, e.target.files[0].size can get the unit is B ha
- File
- LastModified:1478486422000
- LastModifiedDate:Mon-Nov 10:40:22 gmt+0800 (CST)
- Name:"222.jpg"
- Size:124996
- Type:"Image/jpeg"
- Webkitrelativepath: ""
- __proto__:File
})
Continue to refuel, step by step??
E.target.files[0] Layer Anatomy