这里的data不能是json或xml格式,那么string格式的书写形式是怎样的呢?另外有哪些途径可以获知,我查了w3c和慕课网都没有呢 //////////////////////////////// var request = new XMLHttpRequest(); request.open("POST", "serverjson.php"); var data = "name=" + document.getElementById("staffName").value + "&number=" + document.getElementById("staffNumber").value + "&sex=" + document.getElementById("staffSex").value + "&job=" + document.getElementById("staffJob").value; request.setRequestHeader("Content-type","application/x-www-form-urlencoded"); request.send(data);
fishenal
Despicableme01