Currently, I am using the following code to refresh the <div name="content"> portion of a web page
<script type="text/javascript"> window.onload = setupRefresh; function setupRefresh() { setInterval("refreshFrame();", 5000); } function refreshFrame() { parent.content.location.reload(); } </script> </head> <body> <div id="header"> <h1>Arbitrary Header</h1> </div> <div name="content"> <?php //Code here ?> </div>
This works great in Firefox, but Chrome just seems to ignore it. Any suggestions on how to make Chrome work in a similar way?
Just do
as opposed to
For Chrome, and it works just fine.
Edit: This works fine on all three browsers for me.
However, are you sure you don’t want to just pull the data with AJAX calls every five seconds, instead of reloading the whole page? JQuery makes this super-easy to do, both synchronously and asynchronously.