I have a page (index.php) that loads content from a seperate file (it.php) into a div using jQuery like so:
index.php
<script type="text/javascript" src="jq.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
function loadTable(){
$("#li1").load("it.php #segment1");
}
loadTable();
setInterval(loadTable, 3000);
});
<div id="li1"></div>
it.php
<div id="segment1">This text flashes and looks horrible when the page loads</div>
How can i make the whole page load at the same time? At the minute, the html and PHP loads before the jQuery which results in the div's content flashing on load.
I've tried everything but cannot seem to figure it out. I know that it can be done also, as I've seen websites loading dynamic content without it looking hideous.