js禁止選択内容
472 ワード
今日会社は他の人に私達のウェブサイトのものをコピーすることを禁止するように求めて、だからいくつかjsコードの機能をいじりました.
<script type="text/javascript">
function disableselect(e){
return false}
function reEnable(){return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>