class='chkspec' のチェックボックスがいくつかあり、クリックしたチェックボックスの ID 値を xxx.php ファイルに渡します。私の問題は次のとおりです。
1) "specificitem=this.id" で試した ID の渡し方がわからないが、正しい方法かどうかわからない
2) 次のエラーが表示されます: 未定義の変数: 特定のアイテム。これは、specificitem="hello"; を実行した場合にも発生します。
コードは以下です。
if ($('.chkspec').is(":checked")) {
xmlHttp.open('POST', "xxx.php", true);
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4)
{
if (xmlHttp.status == 200)
{
data: {specificitem : this.id }
}
}
};
返信ありがとうございます。