I want to make a chat from scratch and I'm stuck trying to load div using ajax, but when I do that, my whole page shows inside that div.
<script>
function auto_load(){
$.ajax({
url: "chat.php",
cache: false,
success: function(data){
$("#chatbox").html(data);
}
});
}
$(document).ready(function(){
auto_load();
});
setInterval(auto_load,2000);
</script>