1.收藏时用图标显示
<linkREL="SHORTCUTICON"href="http://www.asp888.net/site.ico">
2.TD内容实现不换行
只要使用noWrap属性即可
3.获得客户端文件大小
<imgsrc="http://www.webucn.com/web/p_w_picpaths/banner.gif"onmouseover="this.alt='文件大小为:'+this.fileSize+'字节'">
4.动态删除元素
img1.removeNode(true)

5.模拟按键:

varWshShell=newActiveXObject("WScript.Shell");
WshShell.sendKeys("{F11}");

6.以下语句不需要纠错判断
for(i=2;i<1;i++){}
7.把js文件群打包掉用
<scriptarchive=utils.jarsrc=\'#\'"/script>
8.获得当前选中文本
document.getSelection()
9.获得对象在document.all[]中元素的下标
txt1.sourceIndex
10.滚动文档到窗口顶部或底部
txt1.scrollIntoView(true)
11.段落自动缩进
<pstyle=text-indent:26px>内容</p>
12.客户端IP地址
Request.ServerVariables("REMOTE_HOST")
13.元素投影(可彻底解决网页中投影问题)
filter:progid:DXImageTransform.Microsoft.Shadow(color='gray',Direction=135,Strength=3)
14.图片热区焦点隐藏
<imghideFocus>
15.不能在onload事件中open窗口,否则会被拦截
16.选择本地文件时改变图片源
<inputtype="file"onpropertychange="img.src=\'#\'"/font>
17.获取文件路径
varstr="http://localhost/Home/manage/FCKeditor/dialog/fck_p_w_picpath.html";str=str.replace(/[^\/]+$/,"");
18.js中的trim
String.prototype.trim=function()
{
returnthis.replace(/(^[\s]*)|([\s]*$)/g,"");
}
19.定义样式表的子元素样式
.clsbutton{color:red}
21.文本框tab
<textareaonkeydown="if(event.keyCode==9){clipboardData.setData('Text','');execCommand('paste');returnfalse}"rows=8cols=28>
</textarea>
22.最大化窗口
<OBJECTclassid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"onreadystatechange="if(this.readyState==4)this.Click();"VIEWASTEXT><PARAMname="Command"value="Maximize"></OBJECT>
23.图片title换行符
&#13;
24.对body的click事件重定义
document.body.alert()}
25.10进制转换为16进制
alert((255).toString(16))
26.隐藏链接提示
<style>
a{evt:expression(window.status='')}
</style>
<ahref=http://ywicc.com>nostatusinformation</a>
注意:expression为获焦或失焦时执行,可为寄主创建一参数,使其只执行一次,用于表格控制
27.同时执行两事件
functiondocument.onclick,document.onkeydown(){
window.alert('HelloWorld!!!');
}
28.不显示图片工具栏
<metahttp-equiv="p_w_picpathtoolbar"content="no">
29.页面最大化
<OBJECTclassid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"onreadystatechange="if(this.readyState==4)this.Click();"VIEWASTEXT><PARAMname="Command"value="Maximize"></OBJECT>
30.提交到新的可自义窗口
<formmethod="post"action="1.htm"target="test"onSubmit="window.open('','test','width=100,height=100')">
<inputtype="submit">
</form>
31.用css控制表格间隔色
tr{background:expression=\'#\'"?"red":"")}
32.取得字符的asc码
"s".charCodeAt(0)
33.获得行对象所在行数
o.rowIndex
34.去掉最后一个字符
s.slice(0,-1)
35.获得系统背景色
style=background=\'#\'"/font>
36.表格导出为excel文件
客户端提供链接,在服务器端输出xls文件,由客户保存到客户端即可
服务器端改变文件名的方法是
Response.ContentType="application/vnd.ms-excel"
Response.AddHeader("Content-Disposition","p_w_upload;filename=demo.exe")
37.在模式窗口中链接
<basetarget="_self">
38.求两点夹角
Math.atan2(y1-y0,x1-x0)*180/Math.PI