I have a simple app to add quotes and the possibility to like the quote (not FB like). I have a simple div as a button with following children: a span with the total likes and a paragraph for some text. I need to work with .live() because some of the content is loaded in with AJAX. I need to unbind/die the event because once you clicked the div can t be clicked anymore. But because with .live() you can t use $(this) I tried working with event.target but this has some problems.
我的超文本:
<div class="btnlike">
<span>0</span>
<p>Click to vote</p>
</div>
我的贾瓦特(远与这一事件有关)。
$(".btnlike").live( click ,function(event){
var $target;
if( $(event.target).is("div") ) {
$target = $(event.target);
} else {
$target = $(event.target).parent();
}
$target.unbind(event);
});
但是,我想使用(die)()但因为(这笔)工作没有其他解决办法?