经典javascript效果代码

ContractedBlock.gif ExpandedBlockStart.gif Code
网页禁止保存代码为:
<noscript><iframe src="*.htm"></iframe></noscript>

本机ip
<%=request.servervariables("remote_addr")%>
服务器名
<%=Request.ServerVariables("SERVER_NAME")%>
服务器IP
<%=Request.ServerVariables("LOCAL_ADDR")%>
服务器端口
<%=Request.ServerVariables("SERVER_PORT")%>

网页禁止被缓存的代码 ASP
<%
Response.Expires 
= 0
Response.ExpiresAbsolute 
= Now() - 1
Response.CacheControl 
= "no-cache"
%>

1.将彻底屏蔽鼠标右键,无右键菜单
<body oncontextmenu="window.event.returnvalue=false">

也可以用于网页中Table框架中
<table border oncontextmenu=return(false)><td>no</table>

2.取消选取、防止复制
<body onselectstart="return false">

3.不准粘贴
<body onpaste="return false">

4.防止复制 
<body oncopy="return false;" oncut="return false;">

5.IE地址栏前换成自己的图标
<link rel="Shortcut Icon" href="favicon.ico">

6.收藏夹中显示出你的图标
<link rel="Bookmark" href="favicon.ico">

7.关闭输入法 
<input style="ime-mode:disabled">

说明:这段代码是在表格提交时用到的。也就是在输入数据时不可以使用其他输入法模式。

8.永远都会带着框架

<script language="javascript"><!-- 
if (window == top)top.location.href = "frames.htm";// --></script>9.防止被人frame

<SCRIPT LANGUAGE=javascript><!-- 
if (top.location != self.location)top.location=self.location; 
// --></SCRIPT>

<input style="ime-mode:disabled">

9.查源文件

<input type=button value=查看网页源代码 
onclick
="window.location = 'view-source:'+ 'http://www.e3i5.com/test.htm';"> 

10.屏蔽功能键Shift,Alt,Ctrl
<script>
function look(){ 
if(event.shiftKey) 
alert(
"禁止按Shift键!"); //可以换成ALT CTRL

document.onkeydown
=look; 
</script>

11.光标是停在文本框文字的最后
<script language="java script">
function cc()
{
var e = event.srcElement;
var r =e.createTextRange();
r.moveStart(
"character",e.value.length);
r.collapse(
true);
r.select();
}
</script>
<input type=text name=text1 value="123" onfocus="cc()">
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值