jquery-form/form

feature.fileapi : TypeError: undefined is not a function

AnatoliiTretiakov opened this issue · 4 comments

Path:
jquery.form.js:98
Description:
feature.fileapi = $('<input type="file">').get(0).files !== undefined;
if there is no such input on page, than it will throw "TypeError: undefined is not a function"

Instructions for Reporting a Bug
Would you please create an example of the error on JSFiddle or CodePen so that others can reproduce the issue you're seeing?

https://jsfiddle.net/q0z9d3b7/3/
In this example it returns null, but in my application I have described error.
In anyway null !== undefined => true, but I do not think that it is a result that we want :)

Are you encountering a specific error in using jQuery Form? Line 98 is doing feature detection in the browser, and I wouldn't expect it to log an error.

If you are still experiencing the error, please review the Instructions for Reporting a Bug.
Which version of the plugin are you using?
Which version of the jQuery library are you using?
What browsers (and versions) have you tested in?
How can the error be reproduced?

I am closing this issue due to a lack of information. If you still need help, please comment and we can reopen.