GIDJET
07-26-2004, 11:55 AM
Hi i'm having issues with a javascript random image script, the script works however in ie it puts a line at the end of the image, which distorts the table. Everything works fine in Netscape. The script is below:
<SCRIPT LANGUAGE="Javascript"><!--
function randimg() { } ; r = new randimg() ; n = 0
//-------------Database----------
r[n++]= '<IMG SRC="images/image1.jpg" WIDTH="471" HEIGHT="339" ALT="1">'
r[n++]= '<IMG SRC="images/image2.jpg" WIDTH="102" HEIGHT="102" ALT="2">'
r[n++]= '<IMG SRC="images/3.gif" WIDTH="102" HEIGHT="102" ALT="3">'
r[n++]= '<IMG SRC="images/4.gif" WIDTH="102" HEIGHT="102" ALT="4">'
r[n++]= '.....Just keep adding to database'
//----------------------
i=Math.floor(Math.random() * n) ;
document.write( r[i] )
//--></SCRIPT>
I have tried a number of various scripts however all have the same out come. Any thouughts ?
<SCRIPT LANGUAGE="Javascript"><!--
function randimg() { } ; r = new randimg() ; n = 0
//-------------Database----------
r[n++]= '<IMG SRC="images/image1.jpg" WIDTH="471" HEIGHT="339" ALT="1">'
r[n++]= '<IMG SRC="images/image2.jpg" WIDTH="102" HEIGHT="102" ALT="2">'
r[n++]= '<IMG SRC="images/3.gif" WIDTH="102" HEIGHT="102" ALT="3">'
r[n++]= '<IMG SRC="images/4.gif" WIDTH="102" HEIGHT="102" ALT="4">'
r[n++]= '.....Just keep adding to database'
//----------------------
i=Math.floor(Math.random() * n) ;
document.write( r[i] )
//--></SCRIPT>
I have tried a number of various scripts however all have the same out come. Any thouughts ?