I have a php page that requires another php page, the page seems to take very long to load so I decided to have a loading image, problem is the image appears almost when the whole page loads instead of appearing when the page stsrts loading, how can I solve this?
my code is as follows:
<?php
echo '<div id="mm">mm</div>';
require_once( 'includes/xxxxxxxxxxxx.php' ); ?>
<html>
<head>
<title>myiframe</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js">
</script>
<scriptsrc="http://cdnjs.cloudflare.com/ajax/l
ibs/modernizr/2.8.2/modernizr.js"></script>
<script tyep="text/javascript">
$(window).load(function() {
// Animate loader off screen
$("#mm").fadeOut("slow");
});
</script>
<head>
<body>
</body>
</html>