自荐文章
<!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>区别IE6、IE7、IE8、FireFox的CSS hack</title>
<style type="text/css">
<!--
#test,#note{
margin:0 auto;
text-align:center;
}
.note{ text-align:left; text-indent:40px;}
#test {
width:200px;
height:30px;
border: 1px solid #000000;
color:#fff;
line-height:30px;
}
.color{
&
继续阅读其余的 2074 字
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用javascript判断用户输入email地址是否有效</title>
<script>
function checkEmail(){
var emailPattern = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
if (emailPattern.test(emails.value)==false)
alert("非法的Email地址!")
else
alert("正确的Email地址!")
}
</script>
<body>
<input id=emails><input type=button value=CheckEmail onclick=checkEmail()>
</body>
</html>
亦可以直接使用下面的代码,与上面的代码等效:
<meta
继续阅读其余的 590 字
我在外面测试:能过163邮箱向用户名+labels@gmail.com,邮件正常到达,而且按照事先的过虑设定被自动分类到labels文件夹下(其实并非文件夹)。也就是说传统的E-mail地址中不允许有“+”的规则已经被打破,所以很多注删流程中的E-mail验证也也需要更新一下。
这几天自己看了.net,下面是自己修改的Email验证的正则表达式:
合法E-mail地址:
1. 必须包含一个并且只有一个符号“@”
2. 第一个字符不得是“@”或者“.”
3. 不允许出现“@.”或者.@
4. 结尾不得是字符“@”或者“.”
5. 允许“@”前的字符中出现“+”
6. 不允许“+”在最
继续阅读其余的 553 字
<!-- http://bbs.downcodes.com-->
<!--完成此效果需要两步
第一步:把下面代码放到<head>区域中-->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function ViewImage(form) {
ix = form.width.value;
iy = form.height.value;
ifile = form.url.value;
NS = (document.layers) ? 1 : 0;
localurl = ifile.indexOf('http://') == -1;
if (NS && localurl) ifile = "file:///" + ifile;
var win;
var sWidth;
var sHeight;
win = window.open("","","width="+ix+",height="+iy+",menubar=no,toolbar=no,top=100,left=100");
if (NS) {
sWidth = win.innerWidth;
sHeight = win.innerHeight;
} else {
sWidth = win.d
继续阅读其余的 1861 字
<!-- &&&&&&&&&&---------------------校验密码---------------------&&&&&&&&&& -->
<script language="javascript1.2" type="text/javascript">
function isPassword(obj)
{
 
继续阅读其余的 1666 字
-
下面是常用js校验函数了,它有电话验证,密码验证,用户名,手机验证,IP验证,等。
//校验是否全由数字组成
function isDigit(s)
{
var patrn=/^[0-9]{1,20}$/;
if (!patrn.exec(s)) return false
return true
}//校验登录名:只能输入5-20个以字母开头、可带数字、“_”、“.”的字串
function isRegisterUserName(s)
{
var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){4,19}$/;
if (!patrn.exec(s)) return false
return true
}//校验用户姓名:只能输入1-30个以字母开头的字串
function isTrueName(s)
{
var patrn=/^[a-zA-Z]{1,30}$/;
if (!patrn.exec(s)) return false
return true
}//校验密码:只能输入6-20个字母、数字、下划线
function isPasswd(s)
{
var patrn=/^(w){6,20}$/;
if (!patrn.exec(s)) return fals
继续阅读其余的 1206 字
我们也经常需要用到vertical-align:top的属性。
<!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>JS_MenuBar Tab 滑动效果</title>
<style type="text/css">
.tab { height:23px;}
.tab ul { list-style:none; }
.tab li {
border:1px solid #ccc;
background:#eee;
cursor:pointer;
display:block;
float:left;
text-align:center;
继续阅读其余的 2727 字
