我想启用/禁用元素上的点击事件。 我有以下代码...
HTML:
HTML:
<a id="CP" style="cursor: pointer; text-decoration: underline;">Current Processes</a>
jQuery:
$(document).on("click", "#CP", function(event) {
$this = $(this);
$this.click(function() {
return false;
});
$this.html("Processing...").css({
"text-decoration": "none",
"cursor": "default"
});
$.ajax({
type: 'post',
url: 'abc.jsp',
success: function(process) {
//My code goes here...
$this.on("click"); // Here i want to bind or add handler which is fired previously.
}
});
});
href="#"
并移除cursor: pointer
。你正在使用anchor
像div
一样。 - steoone
事件。http://api.jquery.com/one/ - Qpirate