I am having an issue where a hover event I have does not work after an ajax load, it only works on initial page load. This is the code I am using currently:
$(document).ready(function() {
$('.like').hover(
function () {
var id=this.id;
values=id.split('.');
id=values[0];
type=values[1];
var arrow_box_id='arrow_box'+'_'+id;
document.getElementById(arrow_box_id).style.display = "";
jQuery.ajax({
url: 'fetch_likes_comment.php',
type: 'POST',
data:{
id: id,
type:type
},
beforeSend: function() {
},
complete: function() {
}
}).done(function( msg ) {
document.getElementById(arrow_box_id).innerHTML = msg;
});
},
function () {
var id=this.id;
values=id.split('.');
id=values[0];
type=values[1];
var arrow_box_id='arrow_box'+'_'+id;
document.getElementById(arrow_box_id).style.display = "none";
}
);
});