PDA

View Full Version : JavaScript help please! :)




uzit
May 10, 2009, 06:06 PM
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
May 10, 2009, 06:28 PM
Like so?
document.write('The '+ firstWord +' '+ secondWord + 'the '+ thirdWord);
If not, you'll need to elaborate.

uzit
May 10, 2009, 06:34 PM
That has made space between the firstWord and SecondWord but the the word 'tickles' is right next to the.

Heres the picture! (http://www.quicksnapper.com/uzit/image/untitled-0001)

uzit
May 10, 2009, 07:33 PM
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
May 10, 2009, 07:48 PM
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.

uzit
May 10, 2009, 07:54 PM
Glad you got it. Just needed that space before the string with "the" in it. I missed that my first glance over it.

thank you mate :)

mods can close the thread if they want!