JCO said:
Thanks for both response.
If a JavaScript that is put in a folder named My_Scripts contains a
password, it seems that anyone can get those scripts and see the content (I
think). I did not put stuff in the html for this reason. I did put a
validation form in a script that contains a password.
I know their are a thousand ways to do passwords. My server is a free host,
therefore, server side help is out of the question. I just thought folks
can get the html but not the scripts.... is this true.
JavaScript passwords are only a little more secure than putting the password
in plain sight in your HTML, but only in the same way that holding a gate
closed with a twist of wire can be thought of as securing your yard.
If you really want to secure your site, you need to use other methods such
as server side scripting or features of the operating system (such as
..htaccess files on Unix or file system permissions).
There simply is no such thing as JavaScript security. If you find scripts
online written by any conscientious author they will disclose that fact
right up front. As Steve mentioned, just like any other web file,
JavaScript files are downloaded to the visitor's hard drive before they can
be rendered. Once it's in the browser cache, it's easy for someone to look
at.
If securing your site is a real issue, you may want to consider a more
robust hosting solution. Even a $5/month outfit should be able to meet this
basic need. If you're only worried about casual users getting to the wrong
page, and are willing to accept that it may happen, then the JavaScript
solution you're using will probably do.