How to disable correct click on website?
Disallow users to correct click on your website
Many people are writing blogs too articles on their websites too blogs. They e'er convey a like employment that or thence other peoples are copying their articles too posts of the blog.
![]() |
How to disable correct click on website? |
To resolve this problem, hither is a JavaScript which volition locomote helpful for bloggers too online article writers.
<script type='text/javascript'>
var omitformtags=["input", "textarea", "select"]
omitformtags=omitformtags.join("|")
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
</script>
<script language='JavaScript'>
<!-- //Disable correct mouse click Script var message="Function Disabled!"; /////////////////////////////////// role clickIE4(){ if (event.button==2){ alert(message); provide false; } } role clickNS4(e){ if (document.layers||document.getElementById&&!document.all){ if (e.which==2||e.which==3){ alert(message); provide false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("alert(message);return false") // -->
</script>
var omitformtags=["input", "textarea", "select"]
omitformtags=omitformtags.join("|")
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
}
</script>
<script language='JavaScript'>
<!-- //Disable correct mouse click Script var message="Function Disabled!"; /////////////////////////////////// role clickIE4(){ if (event.button==2){ alert(message); provide false; } } role clickNS4(e){ if (document.layers||document.getElementById&&!document.all){ if (e.which==2||e.which==3){ alert(message); provide false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("alert(message);return false") // -->
</script>
How to usage this code?
To usage this code you lot should locomote follow these instructions:
- If you lot convey a website thence opened upward the page alongside notepad on which you lot desire to disable to create re-create or other activities. Then glue this script only below the <head>.
- If you lot convey spider web log thence usage EDIT HTML primary frame html editor too glue this code only to a higher house the </body>.
Belum ada Komentar untuk "How to disable correct click on website?"
Posting Komentar