發新話題

[資訊][分享] 網頁防護

[資訊][分享] 網頁防護

1.按右鍵跳出視窗警告你 貼到<body>之中<body 貼在這裡面>

oncontextmenu="window.event.returnValue=false;alert('乖乖逛你的網頁,別再亂跑啦!')"
--------------------------------------------------------------------------------
2.按右鍵沒反應囉!貼到<body>之中<body 貼在這裡面>

oncontextmenu="window.event.returnValue=false" onselectstart="event.returnValue=false" ondragstart="window.event.returnValue=false"
--------------------------------------------------------------------------------
3.密碼右鍵~要輸入密碼啦!內容貼到<head>~</head>之間

<!---密碼右鍵開始--->
<SCRIPT LANGUAGE="Javascript">
<!--
var answer=prompt("請輸入使用滑鼠右鍵的密碼");
//type your password here
var password=("1234");
function click() {
if ("event.button==2") {if (password != answer){alert("抱歉,你沒有使用權限唷!")}
}
}
document.onmousedown=click;
// -->
</script>
<!---密碼右鍵結束--->
--------------------------------------------------------------------------------
4.按右鍵就跳頁啦!貼到<body> ~ </body>之間

<script language="JavaScript">
if (navigator.appName.indexOf("Internet Explorer") != -1)
document.onmousedown = noSourceExplorer;
function noSourceExplorer()
{
if (event.button == 2 | event.button == 3)
{
location.replace("按右鍵後要跳頁的網址");
}
}
</script>
--------------------------------------------------------------------------------
5.按右鍵+入我的最愛 內容貼到<HEAD> ~ </HEAD>之間
<!---右鍵變最愛開始--->
<script language=javascript>
<!--
document.onmousedown=click;
document.onkeydown=click;
function click() {
if (event.button==2) {
window.external.addFavorite('你家網址','你家站名')
}
}
// -->
</script>
<!---右鍵變最愛結束--->

TOP

哇~~~超實用的啦!!!

收下來囉!!!!

謝謝大大分享

TOP

看不是很懂,不過還是接收!!
用用看!!謝謝啦~~

TOP

嗯  都很實用
應該會常常用到這些技巧
感謝您的分享

TOP

謝謝大大的分享囉~~
好好的研究一下~~

TOP

發新話題

本站所有圖文均屬網友發表,僅代表作者的觀點與本站無關,如有侵權請通知版主會盡快刪除。