【发布时间】:2017-12-10 05:48:43
【问题描述】:
我试图在 xhttp.open() 中传递两个变量,但在参数列表错误之后我得到了 Uncaught SyntaxError: missing )
function showHint(str,Password)
{
var xhttp;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function()
{
if (this.readyState == 4 && this.status == 200)
{
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp.open("GET","CheckLogin.php?fname=" +str+ "&password="+ Password, true);
xhttp.send();
}
错误信息:Uncaught SyntaxError: missing ) after argument list
我在传递 1 个变量时没有出错。我只在尝试在 xhttp.open() 中传递两个变量时出错。如何在 xhttp.open() 中传递两个变量?
【问题讨论】:
-
我已经解决了这个问题,问题是因为我没有将正确的变量传递给函数。功能正确
标签: javascript ajax