This is my code. It works in Firefox and Chrome but not Safari. I get no errors.
<script>
var cleanData = new FormData();
cleanData.append("test", "test");
alert(cleanData.get("test"));
</script>
Does anyone know a workaround?
This is my code. It works in Firefox and Chrome but not Safari. I get no errors.
<script>
var cleanData = new FormData();
cleanData.append("test", "test");
alert(cleanData.get("test"));
</script>
Does anyone know a workaround?
I solved this by conditionally (if Safari is the browser) iterating through the elements property of an actual form. For all other browser, my wrapper just iterates through FormData entries(). The end result of my function, in either case, is a simple javascript object (JSON) which amounts to name/value pairs.
where IsSafariBrowser() is implemented by whatever your favorite method is, but I chose this:
Example usage in OP's case, assuming that you have an actual form called CleanDataForm instead of creating a FormData from scratch:
Apparently, Safari has no means of getting values stored in FormData objects at this time. There is no workaround at this time, and apparently it's not practical to polyfill.
Sorry :(
Notes: https://developer.mozilla.org/en-US/docs/Web/API/FormData/get#Browser_compatibility https://www.bountysource.com/issues/27573236-is-it-possible-to-polyfill-missing-formdata-methods