Today is . Page created 04/10/06, updated 02/20/07

Image Copyright© At This WebsiteA Hidden Message Looking For Hidden Message
Just type the word "password" which is "Not" case sensitive
on your keyboard to access the secret message.

T his script activates a JavaScript function (Alert Box) with a message when you type a predetermined access code on your keyboard.

W e have tested the code in IE7.0, IE6.0, Firefox1.5.0.1, Opera8.54, Netscape7.02, Netscape8.1 and AOL Explorer1.2. This script worked in IE, Opera8.54 and AOL Explorer1.2. All other platforms tested when you type the predetermined access code on your keyboard, you will not see the effect. It degrades well and you will not get any error messages.

D epending on your knowledge of HTML and javascripts, this is an easy one (1) part copy and paste code that goes in the <HEAD> section of your document. There are only two (2) possible configurations to be made. The first is the acess code and the second is the message you want displayed once the correct code is typed.

Reconfigure Access Code

    <Script language=javascript>
      window.onload=restart
      var code = "Access Code Goes Here"; //no spaces no special chars
      chars=code.split("")
      codes= new Array();
      for(var i=0;i

Reconfigure Message

        }
      function doAction()
        {
            alert("Your Message Goes Here")
        }

    </script>

For Your Information For your Information:     Since this is probably a message you want only certain people to have, instead of having the code in plain site if anyone views the source, a workaround would be to place the code into an external .js file so it is not visible. By making it into an external .js file, you can edit the message and/or access code whenever you need to change it.

I f you are unsure or need a little refresher on howto make this code into an external .js file, it is quite simple.

Step One is to reconfigure the code to your access code and message you want to be seen.

Step Two Once step one is done, you need to copy and paste the complete code that goes in the <HEAD> section section and paste it into a Notepad*

* Note Of Importance Note of Importance ~ In reference to the external JavaScript file that needs to be copied and pasted into a "Notepad" and uploaded into your editor, remember this:

O nce you need to paste and "Save As", you should use a notepad. If you have a Notepad replacement and not using the Microsoft® Notepad, this will not work. You Need To Save it with the Microsoft® Notepad. Reason being is quite simple. Not everyone is using the notepad replacement you are. And by uploading it in the replacement, not all systems will be able to read the external Javascript. The notepad replacement is software that is installed on the individual system (computer). Not all systems will have the installed software for the replacement notepad you may be using. (it is a good bet though that just about every system does have the Microsoft® Notepad). This means your system will not be able to read it and the effect will not work.

Step Three Prior to saving the code as an external .js file, you must remove the top (opening) line of code and also the bottom (closing) line of code. If you don't, it will not work. In other words, remove these two portions of code:

<Script language=javascript>
</script>

I f the above is a little unclear, just scroll through the below textarea box to see what we are explaining.

Step Four Once you removed the above two parts of code, now you need to "save as" whatever you want to call the external .js file with the extension of .js. Save it to anywhere that is convenient because after you "save as", you are just going to upload it into your directory.

Step Five Once you have "saved as" the little icon should look something like this .js File with whatever you named it underneath.

Step Six Once you have uploaded the .js file, you now need to add some code into the <HEAD> section to call the script.

<script type="text/javascript" src="secretmessage.js"> </script>

A s you can notice, we named the external .js file "secretmessage.js". If you uploaded the external file into a different directory, you need to reflect that in the above code.

*     If you are going to upload the secretmessage.js into a different directory than where this effect will be, then you need to reconfigure the below part of the code to reflect where this external script needs to be called from. For example, if you upload this .js script into a directory called "my_js_scripts", then the below code would have to reflect this change.

Default

<script src="secretmessage.js" language="javascript" type="text/javascript"></script>

Reconfigured

<script src="my_js_scripts/secretmessage.js" language="javascript" type="text/javascript"></script>

W e hope our tutorial was easy to follow and we covered everything in detail. If you would like to add this effect into your pages, grab the respective below link and you are there. If you have any problems with this or anything else, feel free to consult our FAQ ] and if you can't find the answer there, contact us ].
Get Code Here ]   [ Rate This Page ]