How to prevent ajax from confirming on success content already in in this case in $('.Mydiv').Append(data);
$(document).ready(function (ajaxCall) {
var offset = 0;
var limit = offset + 4;
var cats_in_home = '<?php echo $myCat ?>';
var request_in_progress = false;
$.ajax({
type: 'GET',
url: 'getActivity.php',
data: {
'offset': offset,
'limit': limit,
'cats_in_home': cats_in_home
},
success: function (data) {
$('.get_communication_with_div_class').html(data);
}
});
$('.MySeconddiv').onclick(function () {
if (request_in_progress) {
return;
}
request_in_progress = true;
$.ajax({
type: 'GET',
url: 'getActivity.php',
data: {
'offset': offset += 6,
'limit': limit,
'cats_in_home': cats_in_home
},
success: function (data) {
$('.Mydiv').append(data);
request_in_progress = false;
}
});
});
});
the problem is when i click the MySeconddiv tag its accept duplicates, plese help i cant find way to find a solution i cant find way to find a solution