您实际上不需要在现代浏览器中执行此操作:
var xhr = new XMLHttpRequest;xhr.open("POST","yourURL");xhr.onload = function(data){ };xhr.send({keyval:"data here"}); // data here!如您所见,您可以将一个对象传递给该
.send方法并将其发送给该方法,而您根本不需要对POST正文(或GET url)中的URI组件进行编码或弄乱。
您当然也可以发送表格数据

您实际上不需要在现代浏览器中执行此操作:
var xhr = new XMLHttpRequest;xhr.open("POST","yourURL");xhr.onload = function(data){ };xhr.send({keyval:"data here"}); // data here!如您所见,您可以将一个对象传递给该
.send方法并将其发送给该方法,而您根本不需要对POST正文(或GET url)中的URI组件进行编码或弄乱。
您当然也可以发送表格数据