PHP学会网 php培训网 PHP暑期培训 PHP寒假培训 PHP假期培训 » 入门和基础知识 » 实用代码
本页主题: 实用代码 打印 | 加为IE收藏 | 收藏主题 | 上一主题 | 下一主题

meiwang12363

该用户目前不在线
级别: 中级程序员
精华: 1
发帖: 1069
威望: 0 点
金钱: 0 PYMB
贡献值: 0 点
在线时间:8(小时)
注册时间:2007-04-26
最后登录:2007-09-04

实用代码



[url=javascript:;]代码[/url]:--------------------------------------------------------------------------------
禁止屏蔽类:
1.禁止右键

2.禁止选择

3.禁止粘贴

4.禁止直接访问 [必须[url=javascript:;]框架[/url]内才行]

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("");

顶端 Posted: 2007-08-30 13:38 | [楼 主]
PHP学会网 php培训网 PHP暑期培训 PHP寒假培训 PHP假期培训 » 入门和基础知识

时:11-21 07:20 Copyright © 2006 phpwhy.com 权
ICP05060669

曳息 -