I use this script to update a div, gathering new information constantly. It works well in every browser, except in Google Chrome where it hangs after a while and the browser turns blue and a small sad graphic tells me there’s something wrong. The rest of the browser stays intact, it’s only the affected tab so it has to do something with this code:
<script type="text/javascript">
setInterval("SANAjax();", 500);
$(function(){
SANAjax = function(){
$("#target").load("page.php");
}
});
</script>
Is it not safe to refresh a div that many times? Will it overload or what not?
I would do it a bit different than that.
Untested:
This makes sure a new request is being made after the current one is finished.
http://api.jquery.com/load/