当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 一些技巧性实用js代码小结

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 一些技巧性实用js代码小结


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-10   浏览: 302 ::
收藏到网摘: n/a

实现页面最大化 默认img图片 屏蔽鼠标右键 取消选取防止复制等实现代码。 实现页面最大化
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
self.focus();
默认img图片
<img alt=""" " onerror=""error.jpg" " src=""mengzhaobin.jpg"" />如果没有mengzhaobin.jpg则显示error.jpg
屏蔽鼠标右键
oncontextmenu="window.event.returnvalue=false"
取消选取防止复制
<body onselectstart="return false">
不准粘贴
onpaste="return false"
防止复制
oncopy="return false;" oncut="return false;"
地址栏和收藏夹前有图标
<link rel="Shortcut Icon" href="favicon.ico"> <link rel="Bookmark" href="favicon.ico">
关闭输入法
<input style="ime-mode:-Disabled">
防止被人frame
if (top.location != self.location)top.location=self.location;
网页不能另存为
<noscript><iframe src="*.html"><iframe><noscript>
查看页面源代码
<input type=button value="查看网页源代码 " onclick="window.location = `view-source:`+ http://ruanchen.com/";>
弹出对话框并跳转
<a href=`javascript:if(confirm("delete?"location="http://ruanchen.com"`>删除a>
弹出窗口在最上面
<body onblur="this.focus();">
上一页来源
document.referrer
没有缓存
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
or <META HTTP-EQUIV="expires" CONTENT="0">
不要滚动条
没有竖条<body style=`overflow:-Scroll;overflow-y:hidden`> body>
没有横条: <body style=`overflow:-Scroll;overflow-x:hidden`> body>
两个都没:<body scroll="no">body>