免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1311 | 回复: 0
打印 上一主题 下一主题

一些JAVASCRIPT [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-03-02 21:16 |只看该作者 |倒序浏览
一些javascript
1.禁止右键

2.禁止选择
3.禁止粘贴
4.禁止直接访问 [必须框架内才行]
if (top == self)top.location.href = "page.htm";
5.禁止frame引用
if (top != self)top.location.href = "page.htm";
6.禁止功能键Shift,Alt,Ctrl
function key(){
if(event.shiftKey) alert("Shift不允许使用!");} document.onkeydown=key;
数据取得类
1.取得分辨率
document.write("宽为"+screen.Width+"高为"+screen.Height)
2.取得地址栏
document.write(self.location)
3.取得地址栏?后参数
var add = top.location;
add = add.toString();
document.write (add.substring(add.indexOf("?")+1,add.length));
常用特效类
1.主页遥控器
文件一.(t1.html)
window.open("t2.html","_blank","width=200","height=200","scroll=no");
文件二.(t2.html)
function op(add){if (window.opener){window.opener.document.location = add;}}
地址1
地址2
地址3
2.只弹一次的窗口
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {offset = document.cookie.indexOf(search)
    if (offset != -1) {offset += search.length;end = document.cookie.indexOf(";", offset);
    if (end == -1)end = document.cookie.length;returnvalue=unescape(document.cookie.substring(offset, end))}
}
return returnvalue;
}
function jx165ad(){
if (get_cookie('jx165ad')==''){
document.cookie="jx165ad=yes"
window.open("ad.html","_blank","width=200","height=200","scroll=no");
}
else {}
}
jx165ad();
3.鼠标放在连接上强行点击
  
function mClk2() {var source=event.srcElement;if (source.tagName=="A"){source.click();self.focus();}}  
document.write("");  


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4582/showart_13872.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP