js loading page message not working on php file
- by eggman20
Merry Christmas guys,
I found a code that displays a loading message using a gif. It uses the onLoad="init()" in the body tag. It works fine on an HTML file but it doesn't when the file is in PHP. Do I need to change anything in here or this just won't work in a PHP file? here's the code:
<body onLoad="init()">
<div id="loading" style="position:absolute; width:100%; text-align:center; top:300px;">
<img src="loading.gif" border=0></div>
<script>
var ld=(document.all);
var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var ie4=document.all;
if (ns4)
ld=document.loading;
else if (ns6)
ld=document.getElementById("loading").style;
else if (ie4)
ld=document.all.loading.style;
function init() {
if(ns4){ld.visibility="hidden";}
else if (ns6||ie4) ld.display="none";
}
</script>
<!-- Content here -->
</body>
Thanks in advance!!!