腳本說明:
第一步:把如下代碼加入<head>區域中
<SCRIPT LANGUAGE=
var js_mult
var js_mult
var js_m
var js_m
var js_iseed=
var js_iseed
var js_iseed
function random(n)
{
if (js_iseed ==
{
now = new Date()
js_iseed = now
+ now
}
js_iseed
js_iseed
var tmp = (((js_iseed
js_m
js_iseed = (tmp +
return (Math
}
var myNumber =
var nGuesses =
function guessnum()
{
var response
var num = parseInt(document
document
nGuesses++ // increase the guess count
response =
if (num < myNumber) response = response +
if (num > myNumber) response = response +
if (num == myNumber)
{
response = response +
nGuesses =
myNumber = random(
}
document
document
document
document
return true
}
function giveup()
{
var response
nGuesses =
response =
myNumber = random(
document
document
document
document
}
</SCRIPT>
<font size=
我手中有一個數
</font>
<SCRIPT>
myNumber = random(
nGuesses =
</SCRIPT>
<FORM onSubmit=
填入你猜的數: <INPUT TYPE=
<INPUT TYPE=
<INPUT TYPE=
</FORM>
<FORM>
你已猜了: <INPUT TYPE=
提示信息: <INPUT TYPE=
</FORM>
第二步:把<body>區域中的內容改為:
<body bgcolor=
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19173.html