FormData () XHR2

I am trying to use FormData (). I tried this code on several versions of Chrome and Firefox.

var fData = new FormData();
fData.append('foo', 'bar');
console.log('formData', fData);

fData, upon registration, only gives me the created object with the prototype FormData and no additional value "foo". There are no errors, it seems that they are failing.

I also tried

var fData = new FormData(formElement);
+5
source share
1 answer

, , , FormData. , , XMLHttpRequest . , ( Chrome) .

, : , , FormData.

+7

All Articles