[thelist] hiding a password in a simple javascript prompt box

Peter-Paul Koch ppk at xs4all.nl
Thu Sep 14 02:28:38 CDT 2000


>So I have set up a very simple javascript that prompts the user for the
>password. If you go to view source you can however can find out what the
>password is. What I would like to know is is there any way that it can be
>hidden from view or not?

No, but you can do it slightly differently. Don't ask for the password, ask
for the page name and do

var x = prompt('Give the page name');
location.href = x;

so that visitors have to know the name of the page in advance to get there.
Your client has to send this name to his clients. The page name doesn't
appear in the source.

ppk




More information about the thelist mailing list