Jul 29, 2012

Tutorial #3: Disable copy text tanpa amaran.

Step 1
- Dari Dashboard -> Design -> Page Elements -> Add a Gadget -> HTML/JavaScript.

Step 2
- Copy code kat bawah pastu paste dalam HTML/JavaScript.
<script type="text/javascript">

//form tags to omit in NS6+:
//http://eking.in
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>
Step 3
- Save.
- Siap.

No comments :