以下是我正在使用的jQuery搜索功能,
$("#btnSearch").click(function () {
debugger
var assoid = $('#txtAssoID').val();
var tassoid = $.trim(assoid);
if ((tassoid == "") || (tassoid == "Ex: Associate Id1; Associate Id2; Associate Id3")) {
alert("Please enter Associate ID");
return false;
} else if (tassoid != "") {
for (var i = 0; i < tassoid.length; i++) {
if (tassoid.charAt(i) == ':') {
alert("colon should not be used");
return false;
}
}
var associateIDs = new Array();
var array = tassoid.split(";");
var array1 = tassoid.split(";").length;
for (var k = 0; k < array1; k++) {
var id = array[k];
associateIDs[k] = id;
if (k == 0) var associate = id;
else var associate = associate + ',' + id;
if (id.length != 6) {
alert("Please enter 6 digit valid Associate ID");
return false;
}
}
}
$.get("Search", {
'AssoIdsForAccess': associate
}, function (data) {
$("#Search").html(data);
$("#btnUpdate").removeAttr("disabled");
})
});
在第一次加载网页时(显示为表格的html数据)表格行显示背景颜色,但是当我第二次搜索id时,未应用背景颜色,这将是该问题的位置?
答案 0 :(得分:0)
试试这个:live('click',function(){})如果你可以使用你必须使用的jQuery 2.0('click',function(){})