function change2(){
var inProgress=false;
var startFrom=10;
$.ajax2({
url:'ajaxcomm.php',
method:'POST',
data:{"user":user},
beforeSend:function(){inProgress=true;
}
}).done(function(data){
data=jQuery.parseJSON(data);
document.getElementById('container').innerHTML = '';
if(data.length>0){
$.each(data, function(index, data){
$("#container").append(data.post);
});
inProgress=false;
startFrom +=10;
}
});
}
document.getElementById('container').innerHTML = '';
if(data.length>0){
$.each(data, function(index, data){
$("#container").append(data.content);
});
inProgress=false;
startFrom +=10;
}
<div style="display:flex;justify-content:space-around;">
<div onclick="change()">
onclick1
</div>
<div onclick="change2()">
onclick2
</div>
<div onclick="change3()">
onclick3
</div>
<div onclick="change4()">
onclick4
</div>
<div onclick="change5()">
onclick5
</div>
</div>
<div id='container'>
Content
</div>
function change(){
var inProgress=false;
var startFrom=10;
$.ajax({
url:'ajaxtabs.php',
method:'POST',
data:{"content":content},
beforeSend:function(){inProgress=true;
}
}).done(function(data){
data=jQuery.parseJSON(data);
document.getElementById('container').innerHTML = '';
if(data.length>0){
$.each(data, function(index, data){
$("#container").append(data.content);
});
inProgress=false;
startFrom +=10;
}
});
}
document.getElementById('container').innerHTML = '';