Javascript 将数组元素附加到FormData';我不能在Firefox15中工作
我正在发出跨域ajax post请求。 有一个客户端功能:Javascript 将数组元素附加到FormData';我不能在Firefox15中工作,javascript,ajax,post,xmlhttprequest,cross-domain,Javascript,Ajax,Post,Xmlhttprequest,Cross Domain,我正在发出跨域ajax post请求。 有一个客户端功能: function getUsersData() { var ids = ["user1_id", "user2_id"]; var fd = new FormData(); $.each(ids, function() { fd.append('identities', this); }); var xhr = new XMLHttpRequest(); xhr.open('POST', 'http://
function getUsersData()
{
var ids = ["user1_id", "user2_id"];
var fd = new FormData();
$.each(ids, function() {
fd.append('identities', this);
});
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://some-domain.com/Home/GetUsersData', true);
xhr.withCredentials = true;
xhr.onreadystatechange = responseHandler; //function is defined and not shown here
xhr.send(fd);
}
在Opera和Google Chrome浏览器中,一切都很好。
但是Firefox说NS\u ERROR\u CANNOT\u CONVERT\u DATA:组件返回故障代码:0x80460001(NS\u ERROR\u CANNOT\u CONVERT\u DATA)[nsIDOMFormData.append]在fd.append('identifications',this)行
它可以是什么以及如何修复此错误 尝试使用唯一键。类似于:fd.append('identity-'+this.id,this)