我如何通过一个变量在xmlhttp.send功能我如何通过一个变量在xmlhttp.send功能
var str = "hello"
xmlhttp.open("POST","./omnama.php",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("fname=+str"); ' it fills the database with str but not with hello
我尝试这些不工作
xmlhttp.send("fname=" +str,"lname=" +cool);
它填补了FNAME有变量值但不是lname,lname给出一个空字符串如果我有很多变量要传递,我该如何组合?
xmlhttp.send(其中 “fname =” + STR); – kukipei
@kukipei它的工作岗位它作为答案我会接受! – niko