📄 newpage2.htm
字号:
<html>
<head>
<title>Magic 8-Ball</title>
<script LANGUAGE="JavaScript">
<!-- Hide this script from old browsers --
function eraser() {
document.form.answer.value = ""
}
function eightball() {
var question = document.form.question.value ;
var quotenumber = 14 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (quotenumber-1) * randomnumber) + 1 ;
var delay = 5000; // Delay time until quote is removed (5 Seconds)
quotes = new Array
quotes[1] = "Don't count on it!"
quotes[2] = "Very doubtful."
quotes[3] = "It is decidedly so."
quotes[4] = "Outlook good!"
quotes[5] = "Better not tell you!"
quotes[6] = "As I see it, YES!"
quotes[7] = "Yes."
quotes[8] = "It is certain."
quotes[9] = "Without a doubt!"
quotes[10] = "You may rely on it."
quotes[11] = "Sign points to yes!"
quotes[12] = "Yes definately!"
quotes[13] = "Concentrate and ask again."
quotes[14] = "My sources say no."
var quote = quotes[rand1]
if (question=="You suck!") {
answer=window.setTimeout("eraser()", delay);
document.form.answer.value = "Ha ha ha, very funny..."
ocument.form.question.value = "";
}
else {
answer=window.setTimeout("eraser()", delay);
document.form.answer.value = quote;
document.form.question.value = "";
}
}
// -- End Hiding Here -->
</script>
</head>
<body BGCOLOR="black" TEXT="white">
<table BORDER="2" CELLPADDING="0" CELLSPACING="0" BORDERCOLOR="black">
<tr>
<td BGCOLOR="white"><i><b><font FACE="helvetica,arial" COLOR="blue" SIZE="+3">8-Ball</font></b></i>
</td>
</tr>
</table>
<table BORDER="2" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
<tr>
<td BGCOLOR="white"><blockquote>
<font COLOR="RED" FACE="helvetica,arial"><p>This is the Magic 8-Ball! Ask it any yes or no
question, and it has an answer for your personal, business, or social problems or
questions. </font></p>
<form NAME="form">
<p><textarea NAME="question" ROWS="5" COLS="50" WRAP="virtual"></textarea></p>
<div align="center"><center><p><input TYPE="button" onClick="eightball()" VALUE="Answer">
<input TYPE="text" SIZE="30" NAME="answer"> </p>
</center></div>
</form>
</blockquote>
</td>
</tr>
</table>
<p><font FACE="helvetica,arial" COLOR="blue">Place this code inside the
<HEAD></HEAD> tags:</font></p>
<p><code><SCRIPT LANGUAGE="JavaScript"><br>
<!-- Hide this script from old browsers --</p>
<p>function eraser() {<br>
document.form.answer.value = "";<br>
}</p>
<p>function eightball() {</p>
<p>var question = document.form.question.value ;<br>
var quotenumber = 14 ;<br>
var randomnumber = Math.random() ;<br>
var rand1 = Math.round( (quotenumber-1) * randomnumber) + 1 ;<br>
var delay = 5000;</p>
<p>quotes = new Array<br>
quotes[1] = "Don't count on it!"<br>
quotes[2] = "Very doubtful."<br>
quotes[3] = "It is decidedly so."<br>
quotes[4] = "Outlook good!"<br>
quotes[5] = "Better not tell you!"<br>
quotes[6] = "As I see it, YES!"<br>
quotes[7] = "Nope!"<br>
quotes[8] = "It is certain."<br>
quotes[9] = "Without a doubt!"<br>
quotes[10] = "Don't get your hopes up!"<br>
quotes[11] = "Sign points to yes!"<br>
quotes[12] = "Definately not!!"<br>
quotes[13] = "Concentrate and ask again."<br>
quotes[14] = "My sources say no."<br>
var quote = quotes[rand1]</p>
<p>answer=window.setTimeout("eraser()", delay);<br>
document.form.answer.value = quote;<br>
document.form.question.value = "";</p>
<p>}<br>
}<br>
// -- End Hiding Here --><br>
</SCRIPT></code></p>
<p><font FACE="helvetica,arial" COLOR="blue">And place this inside the
<BODY></BODY> tags:</font></p>
<p><code><FORM NAME="form"><br>
<TEXTAREA NAME="question" ROWS="5" COLS="50"
WRAP="virtual"></TEXTAREA><P><br>
<CENTER><INPUT TYPE="button" onClick="eightball()"
VALUE="Answer"> <br>
<INPUT TYPE="text" SIZE="30" NAME="answer"><br>
</CENTER><br>
</BLOCKQUOTE><br>
</FORM> </code></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -