Your browser does not seem to support CSS. If images appear below, please disregard them.
toggle
February
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29
Sponsored Links
Latest Postings
Topic Options
Rate This Topic
#19227 - 03/04/04 09:33 AM Javascript problem (please help!)
Joined: Feb 2004
Posts: 7
jonlenin Offline
Junior Member
jonlenin Offline
Junior Member

Joined: Feb 2004
Posts: 7
North Calkalaka
Hey guys,

I read a couple of tutorials and started learning how to program javascript. I tried to do one of the excercises, and the code just doesnt work could someone please help me out? sorry about the weird spacing
Code:
  
<html>
<head>
<title>stuff</title>
<script language ="Javascript">
<!-- hide me
var red_monkey = prompt("What is your name?","Ryan");

var blue_monkey = prompt("what is your favorite color?""Blue");

var green_monkey = "I hate you";

var orange_monkey = "and I hate";

var all_in_one = green_monkey + red_monkey + orange_monkey + blue_monkey;
// stop hiding me -->
</script>
</head>

<body>
<script language = "javascript">
<!-- hide me
document.writeln(all_in_one)
// stop hiding me -->
</script>
</body>
</html>

Top
Sponsored Links
#19228 - 03/04/04 10:20 AM Re: Javascript problem (please help!)
Joined: Dec 2002
Posts: 3,255
§intå× Offline
§intå× Offline



Joined: Dec 2002
Posts: 3,255
Maryland
Not sure if that is what you want, but try that. You were missing a comma...


Code:
var blue_monkey = prompt("what is your favorite color?""Blue");
>
>
>
this should have been 
>
>
>
var blue_monkey = prompt("what is your favorite color?","Blue");
                                                       ^
                                                       Notice the comma
This is the code corrected

Code:
 <html>
     <head>
        <title>stuff</title>
  <script language ="Javascript">
  <!-- hide me
    var red_monkey = prompt("What is your name?","Ryan");
    var blue_monkey = prompt("what is your favorite color?","Blue");
    var green_monkey = "I hate you";
    var orange_monkey = "and I hate";
    var all_in_one = green_monkey + red_monkey + orange_monkey + blue_monkey;
  // stop hiding me -->
  </script>
     </head>
<body>
<script language = "javascript">
  <!-- 
     hide medocument.writeln(all_in_one)
  // stop hiding me -->
</script>
</body>
</html>


My New site OpenEyes
Top
#19229 - 03/05/04 10:29 AM Re: Javascript problem (please help!)
Joined: Feb 2004
Posts: 7
jonlenin Offline
Junior Member
jonlenin Offline
Junior Member

Joined: Feb 2004
Posts: 7
North Calkalaka
Thank you very much sin_tax. this is why programing can sometimes be suck a pain.

Top
#19230 - 03/05/04 11:27 AM Re: Javascript problem (please help!)
Joined: Dec 2002
Posts: 3,255
§intå× Offline
§intå× Offline



Joined: Dec 2002
Posts: 3,255
Maryland
Sure, just keep coming back. You are what this site needs more of. You are already my favorite newbie. You come here seeking knowledge but are already looking for it on your own. I will help guys like you out all day.

Good luck.


My New site OpenEyes
Top

Member Spotlight
Gremelin

Gremelin
Portland, OR; USA
Posts: 7,194
Joined: February 2002
Show All Member Profiles 
Forum Statistics
Forums46
Topics43,855
Posts79,029
Members2,157
Most Online1,567
Apr 25th, 2010
Top Posters(All Time)
UGN Security 37,018
Gremelin 7,194
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Newest Members
Herbert_Sherbert, codemauve, Lillysdragon1984, Brewwit, boa
2157 Registered Users
Who's Online Now
0 registered members (), 1 guest and 0 spiders.
Latest News