I'm new to Java so I just downloaded this code from dynamicdrive.co m and hope to make it work.
I want it to refresh every 5 seconds. Any ideas?
I want it to refresh every 5 seconds. Any ideas?
Code:
<script language="JavaScript1.2">
//Random iframe content- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, and Terms Of use, visit http://dynamicdrive.com
//This credit MUST stay intact for use
var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1
var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1
//Specify IFRAME display attributes
var iframeprops='width=364 height=241 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" allowtransparency="true"'
//Specify random URLs to display inside iframe
var randomcontent=new Array()
randomcontent[0]="http://fake.com/widgets/fake1"
randomcontent[1]="http://fake.com/widgets/fake2"
randomcontent[2]="http://fake.com/widgets/fake3"
randomcontent[3]="http://fake.com/widgets/fake4"
randomcontent[4]="http://fake.com/widgets/fake5"
randomcontent[5]="http://fake.com/widgets/fake6"
randomcontent[6]="http://fake.com/widgets/fake7"
randomcontent[7]="http://fake.com/widgets/fake8"
randomcontent[8]="http://fake.com/widgets/fake9"
//No need to edit after here
if (ie||dom)
document.write('<iframe id="dynstuff" src="" '+iframeprops+'></iframe>')
function random_iframe(){
if (ie||dom){
var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff
iframeobj.src=randomcontent[Math.floor(Math.random()*randomcontent.length)]
}
}
window.onload=random_iframe
</script>
Comment