Vous êtes sur la page 1sur 5

<HTML>

<HEAD>

<META NAME="description" CONTENTS="This is a page using DHTML plus a little


JavaScript for fun.">
<META NAME="keywords" CONTENTS="DHTML, JavaScript, Form, Push-button.">
<TITLE>Please Do Not Press the Button</TITLE>

<SCRIPT>
<!-- language="Javascript"

var alerted_already;
var remark;

function theytyped(form) {
for ( j = 1;
j<=remark.length && remark[j]!=form.myoutxt.value;
j++){}
if (j>remark.length)
form.myoutxt.value = "Do not type here!";
return false;
}

function touched_frog() {
if (!alerted_already) {
alert(""+
""+
""+
""+
""+
"");
alerted_already = true;
}
return alerted_already;
}

function compute(form) {
for (var i = 1;
i<=remark.length && remark[i]!=form.myoutxt.value ;
i++){}
if (i==remark.length)
history.back();
if (i==remark.length-1)
alert("Dear Sir or Madam:"+
"\n\n It has come to our attention that you have been harassing"+
"\none of the buttons on the web. Although most buttons are"+
"\nunderstanding about this type of thing (being repeatedly pressed),"+
"\nsome rogue buttons have decided to form a support group and have"+
"\npetitioned me, the webmaster for funds to provide a secure place for"+
"\nrest and relaxation. Due to the large number of requests, this"+
"\nwarning has been installed:"+
"\n IF YOU PERSIST PRESSING THIS BUTTON,"+
"\nYOU WILL BE EJECTED FROM THIS SCREEN."+
"\n\n Thank you for your cooperation,"+
"\n\n The Federation for Oppressed and Abused Buttons"+
"\n\nenclosure: Message from oppressed complaintant"+
"\n\n\n\nDear Federation for Oppressed and Abused Buttons"+
"\n\n As I have been able to secure your assistance before,"+
"\nI beg your help in stopping the on going abuse I am once again"+
"\nforced to endure. THIS FREAKIN' NUT CASE WILL NOT STOP!"+
"\n\n Sincerely"+
"\n\n Push Me"+
"\n\np.s. I will definitely attend the annual meeting next July");

if (i<remark.length)
form.myoutxt.value = remark[i+1];
else
form.myoutxt.value = remark[1];
}

function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++)
this[i+1] = initArray.arguments[i];
}

remark = new initArray( "Thanks!",


"Once is enough!",
"Are you deaf?",
"Go Away!!..Quit bothering me!!",
"SOMEBODY STOP THIS CRAZY PERSON!",
"I give up. Please stop.",
"I SAID PLEASE, WHAT'S WRONG WITH YOU!",
"I understand your need to push buttons, but please
stop!",
"This is NOT funny!",
"I give up.",
"This is now a back button!");

alerted_already = false;

// end hiding contents -->


</SCRIPT>

<!--This is where I will place my DHTML coding -->

<!-- The following is the CSS for the Heading at the top of the page. -->
<!-- This is the Burlywood Drop Shadow -->
<DIV style="position: absolute;
top: 9px;
left: 11px;
width: 370px;
height: 80px;
font-size: 26pt;
font-family:Arial Black;
color:#DEB887">DHTML&nbsp;(Cascading&nbsp;Style&nbsp;Sheets)</DIV>

<!-- This is the Ivory Highlight -->


<DIV style="position: absolute;
top: 3px;
left: 4;
width: 370px;
height: 80px;
font-size: 26pt;
font-family:Arial Black;
color:#FFFFF0">DHTML&nbsp;(Cascading&nbsp;Style&nbsp;Sheets)</DIV>

<!-- This is the actual Peru Lettering -->


<DIV style="position: absolute;
top: 5px;
left: 6;
width: 370px;
height: 80px;
font-size: 26pt;
font-family:Arial Black;
color:#CD853F">DHTML&nbsp;(Cascading&nbsp;Style&nbsp;Sheets)</DIV>

<!-- This is the Signature Burlywood Drop Shadow Section -->


<DIV style="position: absolute;
top: 34px;
left: 152px;
width: 370px;
color:#DEB887;
height: 20px;
font-style:italic;
font-weight: bold;
font-family: BrushStroke;
font-size: 26pt ">
An&nbsp;Example&nbsp;By&nbsp;Prof.&nbsp;Al&nbsp;</DIV>

<!-- This is the Signature MintCream Hightlight Section -->


<DIV style="position: absolute;
top: 28px;
left: 144px;
width: 370px;
color:#F5FFFA;
height: 20px;
font-style:italic;
font-weight: bold;
font-family: BrushStroke;
font-size: 26pt ">
An&nbsp;Example&nbsp;By&nbsp;Prof.&nbsp;Al&nbsp;</DIV>

<!-- This is the Dodger Blue Signature section -->


<DIV style="position: absolute;
top: 30px;
left: 145px;
width: 370px;
color:#1E90FF;
height: 20px;
font-style:italic;
font-weight: bold;
font-family: BrushStroke;
font-size: 26pt ">
An&nbsp;Example&nbsp;By&nbsp;Prof.&nbsp;Al&nbsp;</DIV>

<STYLE>
<!--
#pos1 {position: absolute; left: 12px; top: 94px;}
#pos2 {position: absolute; left: 10px; top: 140px;}
#pos3 {position: absolute; left: 55px; top: 215px;}
#pos4 {position: absolute; left: 110px; top: 247px;}
#pos5 {position: absolute; left: 20px; top: 240px;}
#pos6 {position: absolute; left: 210px; top: 95;}
-->
</STYLE>
</HEAD>

<BODY BGCOLOR="#FAEBD7" LINK="#CC0033" VLINK="#333399" ALINK="#FF0000">

<SPAN ID="pos6">
</SPAN>

<SPAN ID="pos1" STYLE="font-size: 40pt; font-family: times new roman, serif;


font-style: italic; color:black;">hey...
</SPAN>

<SPAN ID="pos2" STYLE="font-size: 36pt; font-family: arial black, sans serif;


color:maroon;">PLEASE
</SPAN>

<SPAN ID="pos3" STYLE="font-size: 38pt; font-family: times new roman, serif;


font-style: plain; color: #CD853F;">Push
</SPAN>

<SPAN ID="pos4" STYLE="font-size: 38pt; font-family: times new roman, serif;


font-style: plain; color: #CD853F;">the
</SPAN>

<SPAN ID="pos5" STYLE="font-size: 103pt; font-family: times new roman, serif;


font-style: plain; color: darkcyan;">Button&nbsp;Once
</SPAN>

<!--contents start-->
<P STYLE="margin-top: 1in; margin-left: 2in;">

<TABLE ALIGN="right" BGCOLOR="palegreen" WIDTH=75% HEIGHT=220 BORDER=6


CELLSPACING=5 CELLPADDING=5>
<TR>
<TD>
<FONT FACE="arial, helvetica" SIZE="-1">
<FORM NAME="buttons" method="post" onSubmit="return false">
<div align="center"><center><p><input type="button" name="pushme"
value="Push Me"
onClick="compute(this.form)"
onMouseOver="window.status='LEAVE ME ALONE!';
return touched_frog()"> <input type="text"
value=" " name="myoutxt" onBlur="theytyped(this.form)"
onFocus="theytyped(this.form)"
onChange="theytyped(this.form)" size=50> </p>
</center></div>
</FORM>

<P ALIGN="center">Please Push The Button, but be warned, push it only once,
or face the
consequences!!!! </FONT>
<P ALIGN="center">
<FONT SIZE=1 FACE="arial">
<!--page update script-->
<SCRIPT LANGUAGE="JavaScript">
<!--
document.write("This page was updated on: ");
document.write(document.lastModified);
//-->
</SCRIPT>
</FONT>
</P>

</TD>
</TR>
</TABLE>
<!--content stop-->
</BODY>
</HTML>

Vous aimerez peut-être aussi