Tuesday, July 28, 2009

How do I add protection to my html coding?

I want to make it not possible for ppl to view my html coding, if you right click it shud prompt a message. Ive seen it done lotz a timez. can any1 help out????????????

How do I add protection to my html coding?
%26lt;script language="JavaScript1.2"%26gt;








var clickmessage="Right click disabled on images!"





function disableclick(e) {


if (document.all) {


if (event.button==2||event.button==3) {


if (event.srcElement.tagName=="IMG"){


alert(clickmessage);


return false;


}


}


}


else if (document.layers) {


if (e.which == 3) {


alert(clickmessage);


return false;


}


}


else if (document.getElementById){


if (e.which==3%26amp;%26amp;e.target.tagName=="IMG"){


alert(clickmessage)


return false


}


}


}





function associateimages(){


for(i=0;i%26lt;document.images.length;i++)


document.images[i].onmousedown=disable...


}





if (document.all)


document.onmousedown=disableclick


else if (document.getElementById)


document.onmouseup=disableclick


else if (document.layers)


associateimages()


%26lt;/script%26gt;


No comments:

Post a Comment