# javascript/html error



## SLG (Feb 23, 2005)

hey,
im having an issue, on this page I have 4 images that generate randomly, however im having trouble with the '   '

It is saying on ie that there is un 'unterminating string constant' however i cannot see why...

Please help

heres the problem scripting:

<tr> 
<td height="100"><b> </b>
<SCRIPT LANGUAGE="JavaScript">document.writeln('<TD'+'><IMG SRC="'+xoxo[choice]+'" 
HEIGHT=100 WIDTH=100% BORDER=0 ><'+'/TD>');</SCRIPT>
</td>
</tr>

Note its the 2nd line


----------



## SLG (Feb 23, 2005)

sorry i said generate randomly, that is untrue, it is a random picture from a certain number of pictures previously located


----------



## v-six (Sep 12, 2004)

SLG, I'm not sure what your problem is either, but a sidenote:
Unless you used a <b> tag for a specific reason, use <strong></strong> instead when you want bold.


----------



## SLG (Feb 23, 2005)

hehe, i just added that 2 c if it would fix the error, wasn't 2 worried about specifics like that


----------



## SLG (Feb 23, 2005)

any1 have any ideas why its not working?


----------



## SLG (Feb 23, 2005)

ok i finally figured out (i think) that the problems in the main scripting (sorry for the repetition, but i didnt want 2 delete any bits):

<script language="JavaScript" 
type="text/javascript 
var ic = 24; // Number of alternative images var xoxo = new Array(ic); 
// Array to hold filenames xoxo[0] = "graphic1.PhotoshopAlbumSE3.JpegFile"; 
xoxo[1] = "graphic2.PhotoshopAlbumSE3.JpegFile"; xoxo[2] = "graphic3.PhotoshopAlbumSE3.JpegFile"; 
xoxo[3] = "graphic4.PhotoshopAlbumSE3.JpegFile"; xoxo[4] = "graphic5.PhotoshopAlbumSE3.JpegFile"; 
xoxo[5] = "graphic6.PhotoshopAlbumSE3.JpegFile"; xoxo[6] = "graphic7.PhotoshopAlbumSE3.JpegFile"; 
xoxo[7] = "graphic8.PhotoshopAlbumSE3.JpegFile"; xoxo[8] = "graphic9.PhotoshopAlbumSE3.JpegFile"; 
xoxo[9] = "graphic10.PhotoshopAlbumSE3.JpegFile"; xoxo[10] = "graphic11.PhotoshopAlbumSE3.JpegFile"; 
xoxo[11] = "graphic12.PhotoshopAlbumSE3.JpegFile"; xoxo[12] = "graphic13.PhotoshopAlbumSE3.JpegFile"; 
xoxo[13] = "graphic14.PhotoshopAlbumSE3.JpegFile"; xoxo[14] = "graphic15.PhotoshopAlbumSE3.JpegFile"; 
xoxo[15] = "graphic16.PhotoshopAlbumSE3.JpegFile"; xoxo[16] = "graphic17.PhotoshopAlbumSE3.JpegFile"; 
xoxo[17] = "graphic18.PhotoshopAlbumSE3.JpegFile"; xoxo[18] = "graphic19.PhotoshopAlbumSE3.JpegFile"; 
xoxo[19] = "graphic20.PhotoshopAlbumSE3.JpegFile"; xoxo[20] = "graphic21.PhotoshopAlbumSE3.JpegFile"; 
xoxo[21] = "graphic22.PhotoshopAlbumSE3.JpegFile"; xoxo[22] = "graphic23.PhotoshopAlbumSE3.JpegFile"; 
xoxo[23] = "graphic24.PhotoshopAlbumSE3.JpegFile"; 
function pickRandom(range) 
{ if (Math.random) return Math.round(Math.random() * (range-1)); else { var now 
= new Date(); return (now.getTime() / 1000) % range; } } // Write out an IMG tag, 
using a randomly-chosen image name. var choice = pickRandom(ic); // --> 
</script>


----------



## SLG (Feb 23, 2005)

ok,

sorry to go back, but the problems are in this (ignore any post before this one):

<SCRIPT> 
LANGUAGE="JavaScript">document.writeln('<TD'+'><IMG SRC="'+xoxo[choice]+'" 
HEIGHT=100 WIDTH=100% BORDER=0 ><'+'/TD>');</SCRIPT>


ill keep you informed..


----------



## SLG (Feb 23, 2005)

I'm now getting a syntax error on the begining part of line 3:

<SCRIPT> 
LANGUAGE="JavaScript">document.writeln('<TD'+'>'); 
<IMG SRC="'+xoxo[choice]+'" HEIGHT=100 WIDTH=100 BORDER=0> 
('<'+'/TD>'); 
</SCRIPT>


----------



## SLG (Feb 23, 2005)

ok i know the problem is here now (line 3):

<script language="JavaScript"; "type=text/javascript">
document.writeln('<TD'+'>');
<IMG SRC="'+xoxo[choice]+'" HEIGHT=100 WIDTH=100 BORDER=0>
('<'+'/TD>');
</SCRIPT>


----------



## SLG (Feb 23, 2005)

5 errors in this:
1x unreconised symbol
4x missing symbol or operator between identifiers or literals (or space in identifier)

document.writeln('<TD'+'>')<img src="'+xoxo[choice]+'" height="100" width="100" border="0">


----------



## SLG (Feb 23, 2005)

im not sure if ive gone the right way here but the only error here is that it says '+xoxo[choice]+' doesn't exist. its line 55,63,70,77 as shown below
<IMG SRC="'+xoxo[choice]+'" 


ok full source:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>hehe</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body background="nice-backround-byme-blu.jpg">
<script language="JavaScript"; "type=text/javascript">
var ic = 24;
//Number of alternative images
var xoxo = new Array(ic);
//Array to hold filenames
xoxo[0] = "graphic1.Jpeg";
xoxo[1] = "graphic2.Jpeg"; xoxo[2] = "graphic3.Jpeg";
xoxo[3] = "graphic4.Jpeg"; xoxo[4] = "graphic5.Jpeg";
xoxo[5] = "graphic6.Jpeg"; xoxo[6] = "graphic7.Jpeg";
xoxo[7] = "graphic8.Jpeg"; xoxo[8] = "graphic9.Jpeg"; 
xoxo[9] = "graphic10.Jpeg"; xoxo[10] = "graphic11.Jpeg";
xoxo[11] = "graphic12.Jpeg"; xoxo[12] = "graphic13.Jpeg";
xoxo[13] = "graphic14.Jpeg"; xoxo[14] = "graphic15.Jpeg";
xoxo[15] = "graphic16.Jpeg"; xoxo[16] = "graphic17.Jpeg";
xoxo[17] = "graphic18.Jpeg"; xoxo[18] = "graphic19.Jpeg";
xoxo[19] = "graphic20.Jpeg"; xoxo[20] = "graphic21.Jpeg";
xoxo[21] = "graphic22.Jpeg"; xoxo[22] = "graphic23.Jpeg";
xoxo[23] = "graphic24.Jpeg";
function pickRandom(range)
{ if (Math.random) return Math.round(Math.random() * (range-1)); else { var now
= new Date(); return (now.getTime() / 1000) % range; } }
// Write out an IMG tag, using a randomly-chosen image name.
var choice = pickRandom(ic); // -->
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="23%"> </td>
<td width="54%"><img src="logo.jpg" width="100%" height="142"></td>
<td width="23%"> </td>
</tr>
</table></td>
</tr>
<tr>
<td>



</td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100" height="100"> 
<SCRIPT LANGUAGE="JavaScript" "type="text/javascript">;
"document.writeln('<TD'+'><IMG SRC="'+xoxo[choice]+'"
HEIGHT=184 WIDTH=120 BORDER=0 ><'+'/TD>'); </SCRIPT>
</td>
<td width="82%" rowspan="4"> </td>
</tr>
<tr>
<td height="100"> 
<SCRIPT LANGUAGE="JavaScript" "type="text/javascript">;
"document.writeln('<TD'+'><IMG SRC="'+xoxo[choice]+'"
HEIGHT=184 WIDTH=120 BORDER=0 ><'+'/TD>'); </SCRIPT>
</td>
</tr>
<tr>
<td height="100"> 
<SCRIPT LANGUAGE="JavaScript" "type="text/javascript">;
"document.writeln('<TD'+'><IMG SRC="'+xoxo[choice]+'"
HEIGHT=184 WIDTH=120 BORDER=0 ><'+'/TD>'); </SCRIPT>
</td>
</tr>
<tr>
<td height="100"> 
<SCRIPT LANGUAGE="JavaScript" "type="text/javascript">;
"document.writeln('<TD'+'><IMG SRC="'+xoxo[choice]+'"
HEIGHT=184 WIDTH=120 BORDER=0 ><'+'/TD>'); </SCRIPT>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>



Please help, although i generally know my ware around, im still feeling my way in the dark here, im going to sleep now(  ), cya 2morrow :wink:


----------

