I have the following code:
Select a file
When the user clicks on "Select a file", it's also supposed to open the file browser like when you press on the "Browse" button generated by , where the user can select a file.
It works fine in Chrome and IE7. How do I make it work in Firefox?
解决方案
There is a better way to open the dialog (it works across all modern browsers at this time). Just change
jQuery('#file').click();
to
jQuery('#file').trigger('click');