Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

uzit

macrumors regular
Original poster
May 15, 2008
196
0
I cannot seem to separate the 'firstWord' and 'secondWord'!
<HTML>
<HEAD>
<TITLE>Krazy Phrases</TITLE>
<SCRIPT LANGUAGE = "JavaScript">

var firstWord;
var secondWord;
var thirdWord;

firstWord = window.prompt('Please enter your first word','');
secondWord = window.prompt('Please enter your second world','');
thirdWord = window.prompt('Please enter your third world','');
document.write('The '+ firstWord + secondWord + 'the '+ thirdWord);


</SCRIPT>

</HEAD>

<BODY>
</BODY>
</HTML

anyone help? deadline is 2morrow

Thanks!
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
Like so?
PHP:
document.write('The '+ firstWord +' '+ secondWord + 'the '+ thirdWord);
If not, you'll need to elaborate.
 

uzit

macrumors regular
Original poster
May 15, 2008
196
0
Anyways, I managed to get it right - JavaScript is new for me so I am still learning, this is for one my assignments for University.
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
9
USA
Anyways, I managed to get it right - JavaScript is new for me so I am still learning, this is for one my assignments for University.
Glad you got it. Just needed that space before the string with "the" in it. I missed that my first glance over it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.