Whole page loads in div after ajax call
<p>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.</p>

<pre><code>&lt;script&gt;
    function auto_load(){
        $.ajax({
            url: "chat.php",
            cache: false,
            success: function(data){
                $("#chatbox").html(data);
            } 
        });
    }

    $(document).ready(function(){
        auto_load();
    });
    setInterval(auto_load,2000);
&lt;/script&gt;
</code></pre>