ASP.NET网页经典代码(二)

  <% if request("infoid")<>"" then set rs=conn.execute("select * from nproduct where id="&request("infoid")) if not (rs.eof and rs.bof) then proname=rs("proname") content=rs("proinfo") end if rs.close set rs=nothing end if %>
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=查看网页源代码  
οnclick="window.location = 'view-source:'+ '" target=_blank>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=(documents.cookie.substring(offset, end))

}

}

return returnvalue;

}


function loadpopup(){

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

openpopup()

documents.cookie="popped=yes"

}

}

说明:以上是JS代码,请自己加起始符和结束符
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值