| | |
how to prevent exposing java script and CSS in source code
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
Hi...
You cant hide the code in the browser if you have written it in the html/php/js/.. source file..
So in order to hide your css and javascript code, better to create its files..
for eg.. for javascript... create a file with .js extension
say: myscript.js
and write all your javascript code in it.. (without <script></script> tags ofcourse)...
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:
Hope this helps you..
You cant hide the code in the browser if you have written it in the html/php/js/.. source file..
So in order to hide your css and javascript code, better to create its files..
for eg.. for javascript... create a file with .js extension
say: myscript.js
and write all your javascript code in it.. (without <script></script> tags ofcourse)...
And in your html page call this file..
javascript Syntax (Toggle Plain Text)
<script type="text/javascript" language="JavaScript" src="myscript.js">
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:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<head> <link rel="stylesheet" type="text/css" href="style.css"> </head>
Hope this helps you..
yeah but people can still steal them
just put in the path
e.g
http://www.daniweb.com/forums/client...1108-00030.css
just put in the path
e.g
http://www.daniweb.com/forums/client...1108-00030.css
Last edited by jbennet; Dec 5th, 2008 at 8:01 am.
If i am helpful, please give me reputation points.
![]() |
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: missing ) after argument list
- Next Thread: how to disable certain values in the dropdownlist?
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate array automatically beta box browser bug calendar captchaformproblem cart checkbox close codes column createrange() css cursor date debugger decimal dependent design dom download dropdown element embed enter error events firefox focus form frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 iframe images index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsfile jsp libcurl listbox maps masterpage media menu microsoft mimic mp4 onmouseover paypal php player position post problem programming progressbar prototype redirect regex runtime safari scale scriptlets search security select size software sql text textarea unicode w3c website window windowofwords windowsxp






