網頁禁止右鍵代碼
<!--禁止鼠標右鍵代碼-->
<noscript><iframe src=*.html></iframe></noscript>
<script language=javas
<!--
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu(){
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e){
if (window.Event){
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3){
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
document.on
document.on
//-->
</script>
1.將徹底屏蔽鼠標右鍵,無右鍵菜單
<body on
也可以用於網頁中Table框架中
<table border on
2.取消選取、防止複製
<body on
3.不準粘貼
<body on
4.防止複製
<body on
5.IE地址欄前換成自己的圖標
<link rel="Shortcut Icon" href="favicon.ico">
說明:關於favicon.ico文件的製作。你可以先在FW中做一個圖片,屬於你自己站點一 個小圖標。然後在ACD see將文件屬性改爲*.ico,然後將你做的*.ICO文件傳到你的服務器目錄中,然後就可以使用以上代碼來實現,當別人登陸你的站點時,地址欄裏使用 的就是你自定義的圖標了。很PP哦。
6.可以在收藏夾中顯示出你的圖標
在網頁的〈head〉〈/head〉間加入以下語句:
〈link rel="shortcuticon" href="http://…/icon.ico"〉
即可。其中 icon.ico 爲 16x16 的圖標文件,
顏色不要超過 16 色。
說明:製作方法和上面的一樣。只是顯示的方式不同,這個是在別人收藏你的網頁地址時顯示的個性圖標。也很PP.
7.關閉輸入法
<input style="ime-mode:disabled">
說明:這段代碼是在表格提交時用到的。也就是在輸入數據時不可以使用其他輸入法模式。
網頁經典代碼(二)
8.永遠都會帶着框架
<script language="javas
if (window == top)top.location.href = "frames.htm";// --></script>
說明:frames.htm爲你的網頁,這也是保護頁面的一種方法
9.防止被人frame
<SCRIPT LANGUAGE=javas
if (top.location != self.location)top.location=self.location; // --></SCRIPT>
10.網頁將不能被另存爲
<noscript><iframe src=*.html></iframe></noscript>
說明:<noscirpt>的用法很廣,其中一條就是可以使JS廣告失效。
11.查源文件
<input type=button value=查看網頁源代碼
on
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代碼,請自己加起始符和結束符。