Closed suhaotian closed 8 years ago
@LPology
you mean the base64 ?
@dsky1990 no, It's: '''js ... image.focus() image.select() image.blur() console.log(image.value) var src = document.selection.createRange().text alert(src) // null ... '''
plain input file can got image path in < IE10, Simple-Ajax-Uploader can't got the path. I guess the input is dynamic
@suhaotian yes, prior to ie 11, createRange existed on document.selection. this was non-standard. it has since been removed.
today, createRange exists strictly on the document. see: createRange
@suhaotian @dsky1990
I'm slightly confused, is this an issue with the plugin itself?
@suhaotian
You should probably pass the file
argument of the onChange()
callback to previewImage()
:
onChange: function (filename, extension, uploadBtn, fileSize, file) {
previewImage(file, $('#select-img'))
},
Not sure if this fixes your issue, but this is a definitely better approach. The file
argument is the selected file and gets passed to onChange()
as the fifth argument to allow direct access for things like this.
@LPology It does'nt work, I use another way to solve the problem :smile: , thank you
Okay, closing this one out then.
the plain file input in IE can get text (select a image, see console output):
http://jsbin.com/xopatijojo/edit?html,js,output
But, I use the Simple-Ajax-Uploader to select image, code like this:
* document.selection.createRange().text * get null string
but Demo at jsbin was right.
please tell me why