AUTO STORY CREATOR
The following JavaScript is meant to create Story on the basis of few specific wods provided by the user.
<!-- START OF SCRIPT -->
<!-- For more scripts visit http://www.netpedia.com -->
<HTML>
<HEAD>
<TITLE>Madlib</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<SCRIPT LANGUAGE = "JavaScript">
<!--
function create(form) {
if (confirm("Are you sure?")){
storyWin = window.open("",
"StoryWin",
"toolbar=no,width=320,height=325,directories=no,status=yes,scrollbars=yes,resize=no,menubar=no");
with (storyWin.document) {
writeln ("<head><title>Funny Story</title></head><body background = 'raindrp2.gif'><CENTER><FONT COLOR = #00008B SIZE = 6>B<FONT SIZE = 5>RAD</FONT> <FONT SIZE = 6>B<FONT SIZE = 5>AILEY'S</FONT> </FONT></FONT><BR><FONT SIZE = 6 COLOR = #00006b><TT><B>Mad Libs</B></TT></FONT></CENTER></body>");
writeln ("<P><b> One day while I was " + form.input1.value + " in the " + form.input2.value + " a " + form.input3.value + " " + form.input4.value + " fell through the roof. It immediately jumped on the " + form.input5.value + " and knocked over the </b>");
writeln ("<b>" + form.input6.value + ". Then it ran out the door into the " + form.input7.value + " and " + form.input8.value + " a " + form.input9.value + " off the " + form.input10.value + ". </b>");
writeln ("<b> It then knocked a glass of " + form.input11.value + " off the coffee table. After " + form.input12.value + " minutes of chasing the " + form.input4.value + " through the house I finally caught it and put it outside. It quickly climbed the nearest " + form.input13.value + ".</b>");
writeln ("<BR>"); // needs a <BR> to display last line, bug in JS
}
}
}
// -->
</SCRIPT>
</HEAD>
<BODY BGCOLOR = "#FFFFFF" BACKGROUND = "bluetrip.gif" TEXT = "#aaaaaa">
<CENTER>
<font size=+2><TT><B>Mad Libs</B></TT></FONT></CENTER>
<HR><BR><FORM><CENTER><b>
<TABLE BORDER = 1 CELLPADDING = 0>
<TR><TD>
<b>Verb:</b>
<TD><INPUT TYPE="text" NAME="input1" size=45><BR>
</TD></TR><TR><TD>
<b>Room in a House:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input2" size=45 ><BR>
</TD></TR><TR><TD>
<b>Adjective:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input3" size=45 ><BR>
</TD></TR><TR><TD>
<b>Noun:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input4" size=45 ><BR>
</TD></TR><TR><TD>
<b>Piece of Furniture:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input5" size=45 ><BR>
</TD></TR><TR><TD>
<b>Noun:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input6" size=45 ><BR>
</TD></TR><TR><TD>
<b>Room in a House:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input7" size=45 ><BR>
</TD></TR><TR><TD>
<b>Verb:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input8" size=45 ><BR>
</TD></TR><TR><TD>
<b>Noun:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input9" size=45 ><BR>
</TD></TR><TR><TD>
<b>Piece of Furniture:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input10" size=45 ><BR>
</TD></TR><TR><TD>
<b>A Liquid:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input11" size=45 ><BR>
</TD></TR><TR><TD>
<b>Number:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input12" size=45 ><BR>
</TD></TR><TR><TD>
<b>Noun:</b>
</TD><TD>
<INPUT TYPE="text" NAME="input13" size=45 >
</TD></TR><TR><TD></td></tr></table><BR></b>
<INPUT TYPE = "button" VALUE="Create Story" onClick = "create(this.form)"><br><br>
</CENTER>
</FORM>
<!-- END OF SCRIPT -->
0 responses:
Post a Comment
Thanking you for your comment(s). Hope you will visit this blog again!