Am creating a formData object using form id and was doing the following:
var formDataDetails = new FormData(document.getElementById("form_id"));
for (var entry of formDataDetails{
res[entry[0]] = entry[1];
}
Am later doing JSON stringify and doing POST.
But I have found out recently that for..of
loop is not supported in 'Internet Explorer' yet. And I believe using for..in
loop is not correct since it is used to iterate through enumerable objects (loop through properties of an object rather).
How should I go about iterating through formData, for Internet Explorer?