私はdiv要素のクラスが、その後「plblDisAgreeProblem」の場合、私が欲しい、私は二つのクラスわずかな変更でjQueryのセレクタのオプション
$("#plblDisAgreeProblem", "plblDisAgreeComment").click(function(){
var str = {
problemID: $("#problemID").val(),
empID : $("#empID").val(),
commentID : -1
}
$.ajax({
type: "GET",
url: "<%= Url.Action("GetStatus", "Discussion") %>",
data: str,
error: function(msg){
alert("error2" + msg);
},
success: function (msg) {
var out = msg.split("<br/>");
if (out[1] == "DisAgree: True")
{
alert("You are already disagree to this problem.");
}
else
{
}
});
})
とjqueryのセレクタオプションを使用していたにasp.netでのパネルディスカッションを開発していますJSONのcommentIDは-1でなければなりません。divのクラスが 'plblDisAgreeComment'の場合、JSonのcommentIDはthis.idでなければなりませんが、どうすればいいですか?
私のクラスセレクタの
hasClass "。"は必要ありません。それにドットをつける –
@ MarkSchultheissあなたは正しいです。更新しました。ありがとうございました! –