I want to be able to hide my source code so other developers won't be able to see what I have done with my website.
Is there a code to prevent other people from viewing my source code?
Is JavaScript encryption a way to hide my source code?
How Can I Hide My Source Code
Hi
You can make secure your website resource by use some technique. Every web developer wants to make secure their coding. You can use too PHP function in your website for make your code invisible. Because PHP script is a dynamic resource which is invisible even the output of PHP is always visible to all. We can get the result of PHP only but the exact code work virtually in server by stay invisible.
You can use JavaScript to disallow copy – paste in your site. So people can not copy your web content. Maximum web developers are use this JavaScript for keep site unique.
Thanks
How Can I Hide My Source Code
Yeah in javaScript you can easily Disable Right Click Option Solution Also Use Javascript For Your Security Or For your Code Because Is Very Esay to use And Here Is Your Code .you can try on and also u can copy paste this code this will help you in future.
Â
Solution 1.
Â
This Code will Help you To Protect Your CodeÂ
<SCRIPT TYPE="text/javascript">Â
<!–Â
//Disable right click scriptÂ
var message="Sorry, right-click has been disabled";Â
///////////////////////////////////Â
function clickIE() {if (document.all) {(message);return false;}}Â
function clickNS(e) {ifÂ
(document.layers||(document.getElementById&&!document.all)) {Â
if (e.which==2||e.which==3) {(message);return false;}}}Â
if (document.layers)Â
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}Â
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}Â
document.oncontextmenu=new Function("return false")Â
// –>Â
</SCRIPT>Â
Â
2.SolutionÂ
Â
If you don’t like using javascript, you can always use a span tag to position a transparent gif over the top of the image like the example code below. Don't forget, you will need to create a transparent.gif to implement this method.
<span style="background-image: url(images/my_image.jpg)"><img src="images/transparent.gif" width="200" height="150" border="0" alt="Protected Image."></span>
Â