1.表格固定,自动换行
在style加上一句word-break:break-all
2.不出现虚线
<a onclick="window.open()" style="cursor:hand">testtest</a>不出现虚线
<a href="#" hidefocus="true">testtest</a>
a {star : expression(onfocus=this.blur)}
3.asp.net 添加内容里包含html标记时报错解决:
解决方案一:
在.aspx文件头中加入这句:
<%@ Page validateRequest="false" %>
解决方案二:
修改web.config文件:
<configuration>
<system.web>
<pages validateRequest="false" />
</system.web>
</configuration>
因为validateRequest默认值为true。只要设为false即可。
4.滚动
document.write ("<marquee scrollamount='1' scrolldelay='30' direction= 'UP' width='200' id='helpor_net' height='150' onmouseover='helpor_net.stop()' onmouseout='helpor_net.start()'>")
5.取得页面执行时间的代码
protected void Application_BeginRequest(Object sender, EventArgs e)
{
Application["StartTime"] = System.DateTime.Now;
}
protected void Application_EndRequest(Object sender, EventArgs e)
{
System.DateTime startTime = (System.DateTime)Application["StartTime"];
System.DateTime endTime = System.DateTime.Now;
System.TimeSpan ts = endTime - startTime;
Response.Write("页面执行时间:"+ ts.Milliseconds +" 毫秒");
}
///
网页自动刷新
JSP 方式:
response.setIntHeader(“Refresh”,180)
response.setHeader(“Refresh”,”10;URL=http://www.blogjava.net/wujun”)
禁止back space键:<body onkeydown="if(event.keyCode==8) return false;">
禁止ctrl+n:onkeydown="if(event.keyCode==78 && event.ctrlKey) return false;"
HTML方式
<META HTTP-EQUIV="Refresh" CONTENT="2">
<META HTTP-EQUIV="Refresh" CONTENT="2;URL=.http://www.blogjava.net/wujun">
Javascript定时执行某一个动作
<script language=javascript>
<!--
function refresh() {
document.all.btnSearch.click();
}
window.setTimeout("refresh()",5000);
// -->
</script>