我如何通過一個變量在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