Начало
Разное
Тайна Madlib
Вы понятия не имеете о том, какова тема! Это всегда более забавно
Verb:
Room in a House:
Adjective:
Noun:
Piece of Furniture:
Noun:
Room in a House:
Verb:
Noun:
Piece of Furniture:
A Liquid:
Number:
Noun:
JavaScript разное: Тайна Madlib
<!-- TWO STEPS TO INSTALL MYSTERY MADLIB: 1. Paste the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document --> <!-- STEP ONE: Copy this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE = "JavaScript"> <! > <! > <!-- Begin 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 ("<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>"); } } } // End --> </SCRIPT> <!-- STEP TWO: Put this code into the BODY of your HTML document --> <BODY> <CENTER> <FORM> <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)"> </FORM> </CENTER> <!-- Script Size: 3.09 KB -->