让英文字符串超出表格宽度自动换行
<td style="word-wrap:break-word; word-break:break-all;">
永远都会带着框架
<script language="JavaScript">
<!--
if (window == top)top.location.href = "frames.htm"; //frames.htm为框架网页
// -->
</script>
防止被人frame
<SCRIPT LANGUAGE=JAVASCRIPT>
<!--
if (top.location != self.location)top.location=self.location;
// -->
</SCRIPT>
网页将不能被另存为
<noscript><iframe src=*.html></iframe></noscript>
删除时确认
<a href='javascript:if(confirm("确实要删除吗?"))location="del.asp"'>删除</a>
不要滚动条
让竖条没有:
<body style='overflow:scroll;overflow-y:hidden'>
</body>
让横条没有:
<body style='overflow:scroll;overflow-x:hidden'>
</body>
两个都去掉?更简单了:
<body scroll="no">
</body>
鼠标划过,表格变色
<tr οnmοuseοver="this.bgColor='red'" οnmοuseοut="this.bgColor=''">
屏蔽右键
<body οncοntextmenu="return false;">
或
<script language="JavaScript">
<!--
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e)
{
if (window.Event)
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
//-->
</script>
用正则强制输入数字
<input name="id2" type="text" οnkeyup='this.value=this.value.replace(//D/gi,"")'>
禁止输入中文
<input type=text style="ime-mode: disabled ">
不允许文本框自动完成
<input autocomplete=off>
图片变灰,掠过恢复
<img src="http://community.youkuaiyun.com/images/csdn.gif"style="filter:gray"onmo ... "this.style.filter='gray'">
定时跳转到其它页面
<meta http-equiv="refresh" content="5;URL=http://54caizi.com">
TITLE换行
<a href=# title="第一行 第二行 第三行">title分行测试</a>
行背景色渐变
<table width="100%" height="100%">
<tr><td style="FILTER: progid:DXImageTransform.Microsoft.Gradient(endColorstr='#EFF3FF', startColorstr='#94B2F7', gradientType='1')" ></td></tr>
</table>
说明:
功能从startcolorstr渐变到endcolorstr
gardientType 是填充样式,具体值请自己尝试
调用其它页面
<object type="text/x-scriptlet" width="800" height="1000" data="a.htm"></object>