Tuesday, May 22, 2012

Java Script code not running well on ie9

I have this code it suppose to display an ad for 10 seconds then load a embed code.
the thing is that it's working fine on firefox but not ie 9 it's run the ad and the embed code in the same time in the background.
Is there is anyway to resolve this problem.
the code is attached.
thank you



<script type="text/javascript">
var nbsec=10;
var c=0;
var t;
var timer_is_on=0;
var sum=0;
function timedCount()
{
c=c+1;
t=setTimeout("timedCount()",1000);
sum=nbsec-c;
document.getElementById('chrono').innerHTML="<br>Loading .. Please wait "+sum+"secondes";
if(c == nbsec){
stopCount();
document.getElementById('mypub').style.visibility = 'hidden';
document.getElementById('mygame').style.visibility = 'visible';
document.getElementById('mygame').style.display ='block';
document.getElementById('mygame').style.height = 'auto';
document.getElementById('mypub').style.height = '0px';
document.getElementById('mypub').style.padding = '0px';
document.getElementById('mypub').innerHTML="";
}
}
function stopCount()
{
clearTimeout(t);
timer_is_on=0;
}
</script>

<table border ="2" align="center" color="F2FC7E"><tr><td>
<div id="mypub" style="visibility: visible; text-align:center; padding:20px;">

<script>
..............
</script>

<div id="chrono" style="color:#FFF;"></div>
</div>
<div id="mygame" style="visibility: hidden;display:none; height:0px">
<param name="initial_focus" value="true">
<applet>
........................
</applet>
</div>
</td></tr></table>
</div>
<script type="text/javascript">
timedCount();
</script>




No comments:

Post a Comment