View Full Version : code won't work


i'm.unhappy
11-15-2003, 04:09 AM
i tried being smart like what i see all the time here obviously you guys are so smart ok here is the code .......the text doesn't even appear..

<script language="JavaScript" type="text/javascript">
<!-- Script designed for random colored text --
/*
Script made by Chester Moy
please keep lines while copying this code
greatly appreciated
*/
var rc = math.floor(Math.random()*226)
var gc = math.floor(Math.random()*226)
var bc = math.floor(Math.random()*226)
var text = man this is so funny
-->
</script>


<script language="JavaScript" type="text/javascript">
<!--
document.write ('<font style="rgb('rc','gc','bc');">'text'</font>')
-->
</script>

if i can't get one script to work in 1 year i'm going to lay my hands off JS unless someone teaches me lol

MaGiCSuN
11-15-2003, 10:59 AM
from wich site did you got this script? i found one thing but it didn't solved anythng unfortunally:

this:

<!-- Script designed for random colored text --

should be:

<!--
<!-- Script designed for random colored text -->

becaues you are having a --> at the end before </script> so there should also be a beginning one :) and you forgot the > at the end of those two --

have you also added the first part between <head></head> and the second part between <body></body> ? i'm afraid i can't help any further unless you can show me where you got the code from :)

Love,
Mirna

COBOLdinosaur
11-15-2003, 05:54 PM
The syntax is incorrect:

document.write ('<font color="rgb('+rc+','+gc+','+bc+')">'+text+'</font>');

or

document.write ('<font style="color:rgb('+rc+','+gc+','+bc+')">'+text+'</font>');

Though I have always though styling font tags was rather counter-intuitive, or perhaps just an oxymoron.

i'm.unhappy
11-16-2003, 12:09 AM
hmm i tried both of your suggestions but it still didn't work...

COBOLdinosaur
11-16-2003, 02:48 PM
Then post your code or a link to the page. I can't fix; what I can't see, and is sounds like you have additional problems.