I was wondering if it is possible for an ajax request to be triggered from a mouseleave function? I would like the string 'Y' to be sent on when the mouse leaves the li
so it can be updated in the database.
is this possible by any chance?
(function(){
$('li#myId').mouseenter(function(){
var y = 'Y';
}).mouseleave(function(){
$.ajax({
type: 'POST',
url: 'update.php',
data: 'y='+y,
success: function(response){
$('li.#myId').html(response);
}
});
});
})();