|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi,
I'm trying to hide the code in a Javascript file so that it does not appear when a user views the source in their browser. This is how it's normally done (below). But this does not stop the user calling the "validation.js" file directly from the URL location. When I stop access to this file via the apache <Directory> or <Location> directive, then it does not get served even to the JavaScript Engine. It is a case of ALL or NOTHING. Anyway out of this dilema ? I would appreciate your feedback. Thanks, Moh'd document.write('<Script Language="JavaScript" Src="http://www.foo.com/validation.js"></Script>'); |
|
#2
|
|||
|
|||
|
JS is run client side and therefore has to be sent to the client to run, just like you have to send the HTML to the client for it to be displayed.
If you really don't want the user to see your validation process, you'll need to use server side validation scripting using PHP, Perl or some other server side language. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Restricting access to a .js file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|