Go Back   I-Mockery Forum > I-Mockery Miscellaneous Forums > Questions, Suggestions, and Tech Support
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
bigtimecow bigtimecow is offline
rockfuckcunt
bigtimecow's Avatar
Join Date: Jan 2004
Location: mash and two tits
bigtimecow is probably pretty okbigtimecow is probably pretty okbigtimecow is probably pretty ok
Old Feb 10th, 2006, 10:21 AM        guys, review my javascript 'cause it isn't working :(
Quote:
<html>
<head>
<title>Adam Norton's Favorite Color Guessing Game</title>
</head>
<body>
<script language="Javascript">
<!--
var guessColor = prompt("What is Adam Norton's favorite color? (guess 1)","");
if (guessColor == "red")
{
alert("That is correctamundo! You are the master of guessing colors!");
document.write("<h1><font color="red">YOU GUESSED CORRECTLY!</font></h1>");
}
else
{
alert("That is incorrect! My favorite color is hotter than that...");
var guessColor = prompt("What is Adam Norton's favorite color? (guess 2)","");
if (guessColor == "red")
{
alert("That is correctamundo! You are pretty good at guessing colors!");
document.write("<h1><font color="red">YOU GUESSED CORRECTLY!</font></h1>");
}
else
{
alert("That is incorrect! My favorite color reminds people of anger...");
var guessColor = prompt("What is Adam Norton's favorite color? (guess 3 - the last!)","");
if (guessColor == "red")
{
alert("That is correctamundo! You aren't very good at guessing colors, but you got it!");
document.write("<h1><font color="red">YOU GUESSED CORRECTLY!</font></h1>");
}
else
{
alert("That is incorrect! Sorry, that was your final try. The correct answer is red.");
}
}
}

document.write("<h2>If you would like to play again, please press F5.</h2>");
//-->
</script>

</body>
</html>
__________________
Quote:
Originally Posted by Sam
Bigtimecow you are like the Fonz of girls pussies.
Reply With Quote
  #2  
AChimp AChimp is offline
Resident Chimp
AChimp's Avatar
Join Date: Nov 2000
Location: The Jungles of Borneo
AChimp is probably a real personAChimp is probably a real person
Old Feb 10th, 2006, 10:26 AM       
Good God that's the worst code I've ever seen. Look up for-loops.
Reply With Quote
  #3  
AChimp AChimp is offline
Resident Chimp
AChimp's Avatar
Join Date: Nov 2000
Location: The Jungles of Borneo
AChimp is probably a real personAChimp is probably a real person
Old Feb 10th, 2006, 10:28 AM       
And HTML won't show up inside an alert box.
Reply With Quote
  #4  
bigtimecow bigtimecow is offline
rockfuckcunt
bigtimecow's Avatar
Join Date: Jan 2004
Location: mash and two tits
bigtimecow is probably pretty okbigtimecow is probably pretty okbigtimecow is probably pretty ok
Old Feb 10th, 2006, 10:31 AM       
jesus, i just started my class

ahh, but would that be the problem?
__________________
Quote:
Originally Posted by Sam
Bigtimecow you are like the Fonz of girls pussies.
Reply With Quote
  #5  
AChimp AChimp is offline
Resident Chimp
AChimp's Avatar
Join Date: Nov 2000
Location: The Jungles of Borneo
AChimp is probably a real personAChimp is probably a real person
Old Feb 10th, 2006, 11:03 AM       
You're declaring guessColor multiple times, for starters.
Reply With Quote
  #6  
bigtimecow bigtimecow is offline
rockfuckcunt
bigtimecow's Avatar
Join Date: Jan 2004
Location: mash and two tits
bigtimecow is probably pretty okbigtimecow is probably pretty okbigtimecow is probably pretty ok
Old Feb 10th, 2006, 12:48 PM       
ahh yes, you're right. what if i get rid of the "var" before each guessColor after the first declaration?
__________________
Quote:
Originally Posted by Sam
Bigtimecow you are like the Fonz of girls pussies.
Reply With Quote
  #7  
Esuohlim Esuohlim is offline
BOO! A SPOOPY GHOST :x
Esuohlim's Avatar
Join Date: Mar 2003
Location: TO-DO LIST: WATCH TWIN PEAKS. CALL MOM.
Esuohlim won the popularity contestEsuohlim won the popularity contestEsuohlim won the popularity contestEsuohlim won the popularity contestEsuohlim won the popularity contestEsuohlim won the popularity contestEsuohlim won the popularity contestEsuohlim won the popularity contestEsuohlim won the popularity contestEsuohlim won the popularity contestEsuohlim won the popularity contest
Old Feb 10th, 2006, 01:17 PM       
This reminds me of trying to learn MATLAB
__________________


TomWritesAboutStuff.com - The #1 Worst Blog
Reply With Quote
  #8  
AChimp AChimp is offline
Resident Chimp
AChimp's Avatar
Join Date: Nov 2000
Location: The Jungles of Borneo
AChimp is probably a real personAChimp is probably a real person
Old Feb 10th, 2006, 01:18 PM       
Quote:
Originally Posted by bigtimebanned
ahh yes, you're right. what if i get rid of the "var" before each guessColor after the first declaration?
It might work after you do that.

The best way to debug Javascript is with Firefox and its javascript console. It'll tell you exactly what errors it encounters.
Reply With Quote
  #9  
bigtimecow bigtimecow is offline
rockfuckcunt
bigtimecow's Avatar
Join Date: Jan 2004
Location: mash and two tits
bigtimecow is probably pretty okbigtimecow is probably pretty okbigtimecow is probably pretty ok
Old Feb 10th, 2006, 03:44 PM       
well, now that i'm home (i was at school) i'll test it in mozilla
__________________
Quote:
Originally Posted by Sam
Bigtimecow you are like the Fonz of girls pussies.
Reply With Quote
  #10  
bigtimecow bigtimecow is offline
rockfuckcunt
bigtimecow's Avatar
Join Date: Jan 2004
Location: mash and two tits
bigtimecow is probably pretty okbigtimecow is probably pretty okbigtimecow is probably pretty ok
Old Feb 10th, 2006, 03:51 PM       
Quote:
<html>
<head>
<title>Adam Norton's Favorite Color Guessing Game</title>
</head>
<body>
<script language="Javascript">
<!--
var guessColor = prompt("What is Adam Norton's favorite color? (guess 1)","");
if (guessColor == "red")
{
alert("That is correctamundo! You are the master of guessing colors!");
document.write("<h1><font color=#FF0000>YOU GUESSED CORRECTLY!</font></h1>");
}
else
{
alert("That is incorrect! My favorite color is hotter than that...");
guessColor = prompt("What is Adam Norton's favorite color? (guess 2)","");
if (guessColor == "red")
{
alert("That is correctamundo! You are pretty good at guessing colors!");
document.write("<h1><font color=#FF0000>YOU GUESSED CORRECTLY!</font></h1>");
}
else
{
alert("That is incorrect! My favorite color reminds people of anger...");
guessColor = prompt("What is Adam Norton's favorite color? (guess 3 - the last!)","");
if (guessColor == "red")
{
alert("That is correctamundo! You aren't very good at guessing colors, but you got it!");
document.write("<h1><font color=#FF0000>YOU GUESSED CORRECTLY!</font></h1>");
}
else
{
alert("That is incorrect! Sorry, that was your final try. The correct answer is red.");
}
}
}

document.write("<h2>If you would like to play again, please press F5.</h2>");
//-->
</script>

</body>
</html>
yay it works (it looks really messy because there ain't no damn indentation here )

thank you achimp
__________________
Quote:
Originally Posted by Sam
Bigtimecow you are like the Fonz of girls pussies.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

   


All times are GMT -4. The time now is 12:47 AM.


© 2008 I-Mockery.com
Powered by: vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.