0
我有一些类='chkspec'的复选框,我会将单击的复选框的ID值传递给xxx.php文件。我的问题是:将复选框ID传递给带有AJAX的php文件
1)我不知道怎么打发我试着用 “specificitem = this.id”的ID,但我不知道这是正确的方式
2)我得到这个错误:未定义的变量:specificitem。如果我做specificitem =“hello”,这也会发生;
代码如下。
如果($( 'chkspec。')是( “:勾选”)){
xmlHttp.open('POST', "xxx.php", true);
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4)
{
if (xmlHttp.status == 200)
{
data: {specificitem : this.id }
}
}
};
感谢您的答复。