Can we prevent exposing java script and css in source code of web page on the user machine???
please if anybody know about it????
Obviously, the browser needs to be able to see the code in order to render it.
You cant hide the code in the browser if you have written it in the html/php/js/.. source file..
And in your html page call this file..
The browser will only see the above line and not your js code..
For the CSS files.. create a file with extension .css : eg: style.css
And include your styles in this file..
And in the head tag, use the following code:
<head> <link rel="stylesheet" type="text/css" href="style.css"> </head>
Hope this helps you..
sikka_varun thank you for your valueable solution...this is very much working.
jbennet, I think you may prevent these files path to steal by using php or some server side coding, if any body try to open the url, it send him the message "You are not allowed to view this file"...
There is no way to 100% protect it. Its simple. They have to see the code in order to run it, because it is a script.