Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix checking for FormData existence #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yeonhoyoon
Copy link
Contributor

in Safari, typeof FormData returns "object" instead of "function"

in Safari, typeof FormData returns "object" instead of "function"
@ded
Copy link
Owner

ded commented Jul 16, 2014

In that case, is there a more legit way of checking like seeing if it has any unique properties?

@keronsen
Copy link
Contributor

Isn't o['data'] instanceof FormData enough on its own? Why is the typeof check neccesary?

@yeonhoyoon
Copy link
Contributor Author

@keronsen In older browsers, FormData is not defined, so o['data'] instanceof FormData will throw ReferenceError.

@thomsbg
Copy link

thomsbg commented Aug 31, 2015

Any updates on this? According to @yeonhoyoon's last comment, perhaps the check should be:

typeof FormData !== 'undefined', or 'FormData' in window

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants