或許有些人在製作網頁的專題研習時需要使用到登入系統,作簡單的客戶端登入功能。注意請勿使用此 Javascript 作真正用途或用來保護機密資訊。
將以下複製到 HTML 文件的 <head> 與 </head> 內
<script language="javascript">
<!– Begin
function Login(){
var success=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="student" && password=="studentpass") { window.location="student.html"; success=1; }
if (username=="parents" && password=="parentspass") { window.location="parents.html"; success=1; }
if (username=="teacher" && password=="teacherpass") { window.location="teacher.html"; success=1; }
if (username=="admin" && password=="adminpass") { window.location="admin.html"; success=1; }
if (success==0) { alert("帳號不存在或密碼錯誤"); }
}
// End –>
</script>
下面放在 <body> 與 </body> 的位置
<form name="login">
[...]
i-Piggy.com
我愛科技
March 26, 2008
製作簡單的 Javascript 登入系統
February 9, 2008
2 個製作圓角區塊的方法
December 26, 2007
Nifty Anti-aliased Corners
更改圓角角度即可看到效果,並可使用
curvyCorners
利用 Javascript 程式設計圓角,可用於 DIV 元素中。
使用方法:
1. 下載最新版本,並放到網站目錄中
2. 在 <head></head> 標籤內加入:
<script type="text/javascript" src="rounded_corners.js" mce_src="rounded_corners.js"></script>
<script type="text/javascript">
window.onload = function()
{
settings = {
tl: { radius: 20 },
tr: { radius: 20 },
bl: { radius: 20 },
br: { radius: 20 },
antiAlias: true,
autoPad: false
}
var divObj = document.getElementById("mydiv");
var cornersObj = new [...]


