return to tranceaddict TranceAddict Forums Archive > Main Forums > Chill Out Room

Pages: [1] 2 
Fix this Javascript...
View this Thread in Original format
wwu.punisher
...and I will give you a cookie.

I need a function that writes something a number of times defined by a random number. For whatever reason, my brain is ed right now. It's supposed to repeat for every letter in the "secretWord" (which is chosen randomly), but it's only running once.

quote:

for(var i=0; secretWord.length; i++);
{
document.writeln("< td id='secretWord.length + i++'>_< /td>");
}


Note: I had to put in an extra space before the "td" and the "/td" to get the forum to accept the whole line.
Sunflower
pretty sure there's a
code:
test
thing used in the forums
Boomer187
quote:
Originally posted by wwu.punisher
...and I will give you a cookie.



if thats a session cookie I am down!
raveed
you should try www.webdeveloper.com. and post on the javascript forum there.
LeopoldStotch
shouldn't length be ==> length(), since secretWord is a string object ? is it a string object ? "length" is used for an array of objects , and "length()" is defined as a length of a string ?

are you trying to define the word as a string , or an array of characters ?
LeopoldStotch
for(var i=0; secretWord.length; i++);
{
document.writeln("< td id='secretWord.length + i++'>_< /td>");
}

uhhhhh.....

should it be ??

var ii = i++;
document.writeln(
"< td id=\""+secretWord.length()+ii+"\">_< /td>" );

??
i may be wrong .
igottaknow
fcuk ur back again :whip:
Sunflower
is this javascript your big surprise?
igottaknow
quote:
Originally posted by Sunflower
is this javascript your big surprise?

www.snap :stongue:
Enjoy
for(var i=0; i<=secretWord.length; i++) {
document.writeln(i);
}

kofrad
last time i heard from you, you were rambling on about how the jokes on us and you left, supposedly to never return. you return, is this your suprise?
medinaM5
WHY WONT YOU DIE?!!?!?
CLICK TO RETURN TO TOP OF PAGE
Pages: [1] 2 
Privacy Statement