Jump to content

ZmanZL

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by ZmanZL

  1. I've been having a little toruble with IE displaying random pics. It seems that IE dislikes the

    document.write();

    tag. On another forum somebody said that I could edit an existing <img> tag using the DOM but I am not sure about how to do this, please help me.Here's the code:

    function getPic() { // Create Arrays Image = new Array(4); Game = new Array(4); f=new Array(4); c=new Array(4); //Initialize arrays with Pics Image[0] ="http://lco8.atspace.com/games/Images/zz.gif" f[0] = "32" c[0]= "64" Game[0]="Land of Destiny" Image[1] = "http://lco8.atspace.com/games/Images/rya.gif" f[1] = "32" c[1] = "64" Game[1]="Land of Destiny" Image[2]="http://lco8.atspace.com/games/Images/valkal.gif" f[2] = "32" c[2] = "64" Game[2] = "Land of Destiny" //get random index into the arrays i= Math.floor(Math.random()*3); //write it out as HTML document.write('<IMG SRC="' + Image[i] + '" WIDTH="'+f[i]+'" HEIGHT="'+c[i]+'"><br>'); document.write( Game[d]); }

×
×
  • Create New...