开发者

FormData object not capturing the values when sending the request in Safari

开发者 https://www.devze.com 2023-03-13 03:43 出处:网络
I have some code: var formData = new FormData(eForm); var xhr=GetXMLHttpRequest(); xhr.open(\'POST\', surlAjax,false);

I have some code:

var formData = new FormData(eForm);
var xhr=GetXMLHttpRequest();
xhr.open('POST', surlAjax,false); 
xhr.send(formData); 

When I view the request payload in chrome I see:

Request Payload

------WebKitFormBoundary2Sol1RjAh9VTx3uj Content-Disposition: form-data; name="answer"

1 ------WebKitFormBoundary2Sol1RjAh9VTx3uj Content-Disposition: form-data; name="idSlide"

11 ------WebKitFormBoundary2Sol1RjAh9VTx3uj Content-Disposition: form-data; name="sEnduser"

ceff69eabdcd494de62b110c0c7231aa ------WebKitFormBoundary2Sol1RjAh9VTx3uj--

When I view the request Payload in Safari I see:

Request Payload

------WebKitFormBoundary3rBEoL5qcra4nVCd--

The eForm object is an HTMLFormElement object which is required by the constructor of FormData.

Any id开发者_开发知识库eas why the request payload would be different in safari vs chrome?


I've reproduced it on 5.0.5 here... looks like it's a problem with the FormData constructor - it doesn't add all the values in the form, but .append() works just fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消