The show function, according to my logic, should not reload the page, but simply updated but no, it reboots.
How can I just make it refresh without reloading the page?
<html> <head> <meta charset="utf-8"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> <script type="text/javascript" src="jquery.js"></script> </head> <body> <div id="content"> <iframe name='chatWindow' id='chatWindow'frameborder="no" height="935" width="935" src='iframe.php'>Chat</iframe> </div> <br> <input type='text' id="text" name='message'> <input type='button' id="button" value="send"> <script> $(document).ready (function ( ){ show(); setInterval("show()",100); $("#button").bind("click", function (){ var message = $("#text").val(); $.ajax ({ url: "iframe.php", type: "POST", data: {message}, dataType: "html" }); }); $("#button").bind("click", function (){ $.ajax({ url: "chat.html", cache: false, success: function(html){ $("#content").html(html); } }); }); function show() { $.ajax({ url: "chat.html", cache: false, success: function(html){ $("#content").html(html); } }); } }); </script> </body> </html>