為了不讓人看到網站的內容
這裡提供JavaScript鎖右鍵的方法
當然…這是防君子不防小人嚕!
<script type="text/javascript">
document.ondragstart = function () { return false; }
document.oncontextmenu = function () { return false; }
document.onselectstart = function () { return false; }
</script>
kingjoy1235 發表在 痞客邦 留言(0) 人氣(1,785)
kingjoy1235 發表在 痞客邦 留言(0) 人氣(758)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文件</title>
<script language="javascript">
function numcheck(id,time){
var re = /^[0-9]+$/;
if (!re.test(time.value)){
alert("只能輸入數字");
document.getElementById(id).value="";
}
}
</script>
</head>
<body>
<form>
<input type="text" id="aaa" onkeyup="numcheck(this.id,this)" />
</form>
</body>
</html>
kingjoy1235 發表在 痞客邦 留言(0) 人氣(10,489)
<html>
<head>
<script language="javascript">
function verifyAddress(obj)
{
// obtain form value into variable
var email = obj.value;
alert ('email' + email);
// define regex
var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
// test for pattern
flag = pattern.test(email);
if(flag)
{
alert("Right e-mail format!");
return true;
}
else
{
alert("Wrong e-mail format!");
return false;
}
}
</script>
</head>
<body>
<form>
<input name="mail" type="text" onBlur="return verifyAddress(this);">
<input type="submit">
</form>
</body>
</html>
kingjoy1235 發表在 痞客邦 留言(0) 人氣(3,194)