Click to See Complete Forum and Search --> : random message


96turnerri
09-09-2003, 08:32 PM
hi could anyone help me with the following script when rum it says unterminated string constant, but i cant find the source of the error :(

<script type="text/javascript">
text = new Array("Spock, will you please sit down! -- Kirk Star Trek: TMP","No, I'm from Iowa. I only work in outer space. -- Kirk Star Trek IV","Captain, life is not a dream. -- Spock Star Trek V","I need a shower. -- Kirk
Sniffing, Yes. -- Spock Star Trek V","Oh, ****!!! -- Data Star Trek Generations","Smooth as an android's bottom, eh, Data? -- Riker Star Trek Insurrection","... and tell Doctor McCoy, he should have wished me luck. -- Spock The
Immunity Syndrome","Nice Legs... for a human -- Worf Qpid","I am NOT a merry man!!! -- Worf Qpid","Please Mrs. Troi! ... and it's Worf not Woof -- Worf Half a Life","What do you want me to do? -- Q
Die -- Worf Deja Q");
document.write(text[parseInt(Math.random()*text.length)]);
</script>

Aronya1
09-09-2003, 10:39 PM
Originally posted by 96turnerri
"I need a shower. -- Kirk
Sniffing, Yes. -- Spock Star Trek V"

Eliminate a space after "Kirk". When I did that, the page loaded without errors. Nothing displayed, but that's another issue. ;)

Aronya1

pyro
09-09-2003, 11:08 PM
Did you lose your original thread (http://forums.webdeveloper.com/showthread.php?s=&threadid=17039)?

Anyway, make sure the new Array() line is all on one line, and it should work fine.

Aronya1
09-09-2003, 11:21 PM
Yeah! THAT'S what I meant... :)

96turnerri
09-10-2003, 05:12 AM
thanks guys, nothing showed up because it is white text meant for a black background and i am presuming you were on a whith bg

Rich

pyro
09-10-2003, 06:50 AM
So is it working for you now?

96turnerri
09-10-2003, 11:06 AM
yes its working very well thanks for you help pyro m8

pyro
09-10-2003, 11:18 AM
You bet... :)