我正在 asp.net 中开发一个讨论面板,其中我使用带有两个类的 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
{
}
});
})
我想如果 div 的类是“plblDisAgreeProblem”,那么在 JSon 中的 commentID 应该是 -1,如果 div 的类是“plblDisAgreeComment”,那么在 JSon 中的 commentID 应该是 this.id,但我该怎么做呢?
请帮我