I have a web application where users can sent live comments. To load the comments I use a Ajax call like:
<div id="list"></div>
<script>
$(document).ready(function() {
$("#list").load("/live/chat.cfm?live_id=1");
var refreshId = setInterval(function() {
$("#list").load('/live/chat.cfm?live_id=1&randval='+ Math.random());
}, 20000);
});
</script>
In my example every 20 seconds there is a reload of the DIV (list). I was wondering if there is more load friendly way to achieve this?