@TheBearMayJun 03.2008 — #[code=html]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> var srcArr = new Array(); srcArr[0]="pg1.htm"; srcArr[1]="pg2.htm"; srcArr[2]="pg3.htm";
window.onload = function (){ var ranNum=Math.floor(Math.random()*(srcArr.length)); document.getElementById("randomFrme").src=srcArr[ranNum]; } </script> </head>
@KorJun 04.2008 — #Yea, I could have bet from the beginning that you have more than a single [B]window.onload[/B].
There are several solutions. One of them: Remove the red from <i> </i><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" [COLOR="Red"]onLoad="preloadImages('images/buttons/naslovna-over.gif','images/buttons/vodic-over.gif','images/buttons/rep-over.gif','images/buttons/grupe-over.gif','images/buttons/ras-over.gif','images/buttons/stat-over.gif','images/buttons/his-over.gif','images/buttons/slike-over.gif','')"[/COLOR]>
and call that function along with the others stetemnts, in a single window.onload handler (add the blue): <i> </i>window.onload = function (){ var ranNum=Math.floor(Math.random()*(srcArr.length)); document.getElementById("randomFrme").src=srcArr[ranNum]; [COLOR="Blue"]preloadImages('images/buttons/naslovna-over.gif','images/buttons/vodic-over.gif','images/buttons/rep-over.gif','images/buttons/grupe-over.gif','images/buttons/ras-over.gif','images/buttons/stat-over.gif','images/buttons/his-over.gif','images/buttons/slike-over.gif','');[/COLOR] }
@KorJun 04.2008 — #It is a general rule, not only for [B]window.onload[/B]. In the whole code should be only a single event of the same type applied upon the same element. There are javascript methods to [I]add[/I] new functions to be called within a pre-existent event, but this is another topic.