0
I have a function that does some actions inside my html, the main is, this function does a request with ajax and returns me a list that is included directly in select. need q she make request only once when pass the mouse! because every time I move the mouse it makes a new request and updates select someone can help me?
$(".linha").mouseover(function () {
var thDescricao = $(this).children('th.th-descricao');
var thSimilar = $(this).children('.th-similar').children('select');
var descricao = thDescricao.text();
$.ajax({
type: 'GET',
url: 'similaridade/' + descricao + '/',
success: function (data) {
thSimilar.html(data);
},
error: function (data) {
thSimilar.html(data);
},
});
});
Creates a variable with value 0, when passing the mouse feeds it with value 1 and checks whether the value is 0 or 1, if it is 1 does not execute AJAX
– caiocafardo
missing a complement is a table need to do this for each row of it
– Marcos Alves
variable blocks when doing on other lines
– Marcos Alves