I would like to ask a slightly abstract question. Maybe there is someone who can help me.
I want to update a section of the html page with Ajax after clicking on the div with class update
or delete
.
$('.update').on('click',function(){
$.post(ajaxurl, content, function(data){
$('.data-section').html(data);
});
});
data
contain multiple blocks of menu
, hence many clickable div Update
and Delete
.
<div class="data-section">
<div class="menu">
<div class="Update">
Update
</div>
<div class="Delete">
Delete
</div>
</div>
</div>
When I refresh that section with ajax, no div of that section work afterwards. I have to refresh the page for the div to work again. Is this a usual behaviour? How can I manage this problem?