当前位置:首页 >> 学习园地 >> 网站开发 >> 网页设计技巧 >> 网页经典代码(二)
网页经典代码(二)
发布时间:2007-09-16 22-39-53 作者:
8.永远都会带着框架

<script language="javascript"><!--
 if (window == top)top.location.href = "frames.htm";// --></script>

说明:frames.htm为你的网页,这也是保护页面的一种方法


9.防止被人frame

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

10.网页将不能被另存为

<noscript><iframe src=*.html></iframe></noscript>
说明:<noscirpt>的用法很广,其中一条就是可以使JS广告失效。

11.查源文件

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


12.COOKIE脚本记录,有很大的用处哦

function get_cookie(Name) {
var search = Name + "="

var returnvalue = "";

if (documents.cookie.length > 0) {

offset = documents.cookie.indexOf(search)

if (offset != -1) { // if cookie exists

offset += search.length

// set index of beginning of value

end = documents.cookie.indexOf(";", offset);

// set index of end of cookie value

if (end == -1)

end = documents.cookie.length;

returnvalue=unescape(documents.cookie.substring(offset, end))

}

}

return returnvalue;

}


function loadpopup(){

if (get_cookie('popped')==''){

openpopup()

documents.cookie="popped=yes"

}

}

说明:以上是JS代码,请自己加起始符和结束符
编辑: 点击次数:
版权所有 ©2005-2009 河南新华电脑学院 Copyright Henan  XinHua Computer Collage All rights reserved
网络实名:河南新华电脑学院 河南电脑学院 河南电脑培训 郑州电脑学校 郑州计算机机学校
设计制作:奇点WEB工作室 E_mail:hu.fangyuan@xhgroup.cn 豫ICP备05012296号