显示状态拦固定文字:
| 放在body前 <base onmouseover="window.status='这里是goaler的blog系统,欢迎访问';return true"> |
用键盘打开网页
| <script language=javascript> document.onkeydown=gopage var add="admin/addarticle.asp" var logon="admin/logon.asp" function gopage() { if (event.keycode==13) location=add if (event.keycode==38) location=logon } </script> |
|
有时为了方便使用iframe,但被潜入的页面长度不是固定的,显示滚动条不仅影响美观还对用户操作带来不便,自动调整高度可以解决这个问题。^_^ function f_framestyleresize(targobj) var bloadcomplete = false; |
禁止页面正文内容被选取
| <body oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false"onmouseup="document.selection.empty()"> |
消除ie6自动出现的图像工具栏,设置 galleryimg属性为false或no .
| <img src="mypicture.jpg" height="100px" width="100px" galleryimg="no"> |
防止点击空链接时,页面往往重置到页首端。
| 代码“javascript:void(null)”代替原来的“#”标记 |
如何避免别人把你的网页放在框架中
| <script language=“javascript”><!--if (self!=top){top.location=self.location;} -->< /script> |
页面定时刷新
| <meta http-equiv="refresh" content="秒" > |
页面定时转向新的地址
| <meta http-equiv="refresh" content="秒;url=url"> |