这在 Firefox 中有效,但在 IE 中没有任何作用:
$("#_results").autocomplete({
source: data,
minLength: 0,
select: function(event, ui) {
$("#log").empty();
log(ui.item.lname + ", " + ui.item.fname + " " + ui.item.sso);
log("Currently in " + ui.item.currentRotation + " rotation");
log("Graduated from: " + ui.item.college);
log("More details can be viewed by clicking here");
$("#log").attr("onclick", "location.href=\'" + ui.item.dataformEntry + "\'\;");
}
具体来说$("#log").attr("onclick", "location.href=\'" + ui.item.dataformEntry + "\'\;");
还有另一种方法可以做到这一点吗?