简体   繁体   中英

jQuery ajax like file upload with iframe

http://mypokerpartner.com/

Test is at the link above.

$('a').click(function(){
    $('input[type="file"]').click();
});
$('input[type="file"]').on('change', function(){
    $('form').submit();
});

When using the form's browse button the file is submitted on change. when using the link for "A" IE throws an error of SCRIPT5: Access is denied.

I want for the anchor link to invoke the file dialog and when a file is selected it auto submits the file to the iframe for a non-reloading file upload

EDIT: Looks only to be a problem in IE9

Thanks in advance

For some reason unknown to me, while the input field had any name attribute it would IE would throw the error. Removing the name attribute for the file input field fixed this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM