so I have this javascript/jquery to make a delay before showing a swf file, but its not working, when I say not working, I mean it does nothing…
Here is the script:
<script src="http://code.jquery.com/jquery-1.8.0.min.js" ></script>
<link href="http://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css" >
<script>
function Func1()
{
$('#stage').html("<OBJECT style="z-index:2; position:absolute; top:20%; left:44%;" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="320" HEIGHT="240" id="rice" ALIGN="">
<PARAM NAME=movie VALUE="rice.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#333399> <EMBED src="rice.swf" quality=high bgcolor=#333399 WIDTH="320" HEIGHT="240" NAME="rice" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED> </OBJECT>");
}
function Func1Delay()
{
setTimeout("Func1()", 10000);
}
</script>
Here is how I am calling the function:
<body onload="Func1Delay()" >
It seems to be doing absolutley nothing… Thanks in advance.
You have to escape the
"in the object tag or else you’ll get syntax errorsAlso according to MDN using a string of code fot setTimeout is not recommended. use
setTimeout(Func1, 10000);instead.