Closed Bug 625280 Opened 14 years ago Closed 14 years ago

how can i check whether browser supports javascript "FormData()" or not?

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, enhancement)

x86
All
enhancement
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: glxguru, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13

I cant check for browser supports "FormData()" by if-else .. or is there any another method to check it 

I tried like this
 if(FormData())
{
//do Something good ever 
}
else 
{
//do something  by old way
}



Reproducible: Always

Steps to Reproduce:
1.write html code to drag & drop
2.use fd = new FormData()
3.check for support of fd;
Actual Results:  
Error produced like FormData is not defined in Older browser

Expected Results:  
if(FormData())
{
//do Something good ever 
}
else 
{
//do something  by old way
}



or provide an element for its value can be assigned by single or multiple objects at a time which should be POST'ed by form or without submitting form like by 
var xhr = XmlHttpRequest();
//assgn objects here
eg. <tag name="obj"></tag> for obj.setattribute('value','multipleObjectsCollection');
 //finally
xhr.send(obj);
//withot submitting form
How can i get solution over this. how much time required?
OS: Linux → All
This is not a security bug.  Bugzilla is also not a support forum; please don't abuse it as such.

I strongly suggest getting a decent JS book, so you understand the difference between |if (FormData)| and |if (FormData())|.
Group: core-security
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.