Password Protect | JavaScriptSource

Password Protect

JavaScriptSource Staff Jun 17, 2005
Use this script to protect online files. Users cannot cancel out of it. It can also be used with your browser's home page to control Internet access on your own computer.

The JavaScript Source: Password Protection: Password Protect

Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Command-s). The script is yours!!!


Did you use this script?  Do you like this site?  Please link to us!

Leave a Response


Hi, I have tried using this but once you put the correct password in, it is opening the next page INSIDE the html snippet box (I am using Moonfruit). Is there any way to get the link to open in a new page? Thanks

Nina Taylor Aug 20, 2014

Don, you might wanna check out this code. I customized it so the person will be redirected to index.html if password if incorrect. I have set the password to ''enteryourpasswordhere''. [removed] //