dcslick
June 10th, 2005, 11:35 AM
I am in a web class and we have to create a story where the user inputs infomation and then javascript then puts that info into the story itself. Well I have the user input working correctly but I am having problems with putting the gathered info from the users into the story itself. Where the parenthesis are is where I want what used added to go into the story. Can someone please assist?
TIA
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>The Hare and the Tortoise</title>
</head>
<body>
<script type="text/javascript">
<!--
var story = "";
var a1, a2, a3, a4, a5, a6;
// prompts user for a name for the Hare
a1 = window.prompt("Enter a name for the Hare.", "");
// prompts the user for a name for the tortoise
a2 = window.prompt("Enter a name for the Tortoise.", "");
// prompts the user for a descriptive adjective
a3 = window.prompt("Enter a descriptive adjective.", "");
// prompts the user for a descriptive adjective
a4 = window.prompt("Enter another descriptive adjective.", "");
// prompts the user for a verb
a5 = window.prompt("Enter a verb.", "");
// prompts the user for a noun
a6 = window.prompt("And finally enter a noun.", "");
document.write(story);
//-->
</script>
<p>The Hare and the Tortoise<br>
<br>
The Hare was once boasting of his speed before the other
animals. "I have never yet been beaten," said he, "when I put forth my full
speed. I challenge any one here to race with me." <br>
<br>
The Tortoise (name goes here) said quietly, "I accept your (descriptive adj)
challenge." <br>
<br>
"That is a (descriptive adj) good joke," said the Hare; "I could (enter a
verb)dance round you all the way." <br>
<br>
"Keep your boasting till you've beaten," answered the Tortoise. "Shall we race?"
<br>
<br>
So a course was fixed and a start was made. The Hare darted almost out of sight
at once, but soon stopped and, believing that the Tortoise could never catch
him, lay down by the wayside to have a (noun)nap. The Tortoise never for a
moment stopped, but went on with a slow but steady pace straight to the end of
the course. <br>
<br>
When the Hare awoke from his nap, he saw the Tortoise just near the
winning-post. The Hare ran as fast as he could, but it was too late. He saw the
Tortoise had reached the goal. Then said the Tortoise: <br><br>
"Slow and steady wins the race." </p>
</body>
</html>
TIA
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>The Hare and the Tortoise</title>
</head>
<body>
<script type="text/javascript">
<!--
var story = "";
var a1, a2, a3, a4, a5, a6;
// prompts user for a name for the Hare
a1 = window.prompt("Enter a name for the Hare.", "");
// prompts the user for a name for the tortoise
a2 = window.prompt("Enter a name for the Tortoise.", "");
// prompts the user for a descriptive adjective
a3 = window.prompt("Enter a descriptive adjective.", "");
// prompts the user for a descriptive adjective
a4 = window.prompt("Enter another descriptive adjective.", "");
// prompts the user for a verb
a5 = window.prompt("Enter a verb.", "");
// prompts the user for a noun
a6 = window.prompt("And finally enter a noun.", "");
document.write(story);
//-->
</script>
<p>The Hare and the Tortoise<br>
<br>
The Hare was once boasting of his speed before the other
animals. "I have never yet been beaten," said he, "when I put forth my full
speed. I challenge any one here to race with me." <br>
<br>
The Tortoise (name goes here) said quietly, "I accept your (descriptive adj)
challenge." <br>
<br>
"That is a (descriptive adj) good joke," said the Hare; "I could (enter a
verb)dance round you all the way." <br>
<br>
"Keep your boasting till you've beaten," answered the Tortoise. "Shall we race?"
<br>
<br>
So a course was fixed and a start was made. The Hare darted almost out of sight
at once, but soon stopped and, believing that the Tortoise could never catch
him, lay down by the wayside to have a (noun)nap. The Tortoise never for a
moment stopped, but went on with a slow but steady pace straight to the end of
the course. <br>
<br>
When the Hare awoke from his nap, he saw the Tortoise just near the
winning-post. The Hare ran as fast as he could, but it was too late. He saw the
Tortoise had reached the goal. Then said the Tortoise: <br><br>
"Slow and steady wins the race." </p>
</body>
</html>