1 頁 (共 1 頁)

[javascript]如何禁止複製網頁內容文字

發表於 : 2008年 11月 27日, 11:09
tim
最簡單容易的做法, 就是直接利用 body 的 onselectstart event 直接設為 "return false" 即可, 若是要讓右鍵失效, 就利用 oncontextmenu 設為 "return false" 即可, 範例如下,

代碼: 選擇全部

<body onselectstart="return false" oncontextmenu="return false"> 
test text

ha ha you can't select

and you can't use the right click!!
</body>