[Web样式/脚本/标签收藏]

无提示关闭窗口
<input type="button" onClick="window.opener = 'xxx';window.close();" value="IE6最简单的无提示关闭窗口" >

javascript 预装载图片
<script language="JavaScript">
var img = new Image();
img.src = "http://community.csdn.net/images/CSDN_logo.GIF";
</script>
<body οnlοad="javascript:img1.src=img.src">
<img id=img1>
</body>

文章列表中常用的颜色交替
<style>
tr{background-color:expression((this.rowIndex%2==0)?"blue":"red");ryo:expression(οnmοuseοver=function(){this.style.backgroundColor=(this.style.backgroundColor!='gray'?'gray':((this.rowIndex%2==0)?"blue":"red"))},οnmοuseοut=function(){this.style.backgroundColor=(this.style.backgroundColor!='gray'?'gray':((this.rowIndex%2==0)?"blue":"red"))})}
</style>
<TABLE width="200" cellpadding="0" cellspacing="2" border="0" id="t1">
<TR><TD>1</TD></TR>
<TR><TD>1</TD></TR>
<TR><TD>1</TD></TR>
<TR><TD>1</TD></TR>
<TR><TD>1</TD></TR>
<TR><TD>1</TD></TR>
<TR><TD>1</TD></TR>
<TR><TD>1</TD></TR>
</TABLE>

网页倒过来
<style type="text/css">
<!--
body {filter:FlipH() FlipV();}
-->
</style>

修改任意WEB元素
<table id="test">
<tr>
<td>gfd</td>
<td>gfdgsfdgfs</td>
</tr>
</table>
<script language="javascript">
document.getElementById("test").outerHTML="<table><tr><td><img src='http://www.sina.com.cn/images/logo.gif'></td></tr></table>";
</script>

常用JS验证
<script language=Vbscript>
Function IsVerify(patrn,strng)
strng=Trim(strng)
Select Case patrn
Case "User" '用户名
patrn="^[a-z]{1}([a-z0-9]|[._]){2,19}$"
Case "Truename" '英文姓名
patrn="^[a-zA-Z]{1,30}$"
Case "Passwd" '密码
patrn="^(/w){6,20}$"
Case "Tel" '电话/传真
patrn="^[+]{0,1}(/d){1,3}[ ]?([-]?((/d)|[ ]){1,12})+$"
Case "Mobil" '手机
patrn="^(/d)+[-]?(/d){6,12}$"
Case "Date" '日期(格式:yyyy-mm-dd)
patrn="^[12]{1}(/d){3}[-][01]?(/d){1}[-][0123]?(/d){1}$"
Case "Email" '电子邮件
patrn="^((/w)|[-]|[.])+@(((/w)|[-])+[.])+[a-z]{2,4}$"
Case "Postalcode" '邮政编码
patrn="^[a-z0-9 ]{3,12}$"
Case "Search" '搜索关键字
patrn="^[^`~!@#$%^&*()+=|///[/]/{/}:;/'/,.<>/?]{1}[^`~!@$%^&()+=|///[/]/{/}:;/'/,.<>?]{0,19}$"
Case "Int" '整数
patrn="^[1-9]{1}[0-9]{0,5}$"
Case "Array"
patrn="^[0-9]{1}([0-9]|[/,]){0,150}$"
End Select
Dim regEx
Dim Match
Set regEx = New RegExp
regEx.Pattern = patrn
regEx.IgnoreCase = True
regEx.Global = True
Matches = regEx.test(strng)
IsVerify = Matches
Set regEx = Nothing
End Function
</script>

onblur事件时调用IsVerify("Email",value)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值