1. Tech

Your suggestion is on its way!

An email with a link to:


was emailed to:

Thanks for sharing About.com with others!

Cryptogram Script

2. Array Script

clr gif

Enter the texts to be encrypted into the form below. Don't worry about whether you enter upper or lower case because all of the letters are going to be encrypted in uppercase anyway. Anything you enter that are not letters will be retained intact in the output. Once you have entered each individual text select the "Add" button to add the encrypted version to the array.

Continue adding as many texts as you require. You can add as many as you like but if you add too many then your quiz page may take a long time to load. If you are going to set up a daily cryptogram page then you will need 31 texts in the array.

The script code for the cryptogram array will appear in the text box below with an additional statement being added for each text you add. Don't worry if you make a mistake as you can always delete lines from the resulting code if you want to remove questions. If you decide you want to start over, simply refresh the current page.

Please note that you can't enter HTML into the text to be encrypted because that will get encrypted as well.

Once you have finished entering your texts, copy the code from the above text box and save it as a file called cryptoarray.js. You can rearrange the lines if you want to change the order of the texts or delete lines to remove texts you decide not to include. The only limitations are that you cannot change the first three lines of the code, you must assign a value to codenum and you must have at least one text for the crypto script to work.

Select whether you want the script to display a different cryptogram daily or whether you want to use random selection and remove the // from the appropriate line at the bottom of the script. You can write your own code into the end of the script to set codenum to the cryptogram entry to display if neither of these options suits you.

If you are creating more than one cryptogram page then you can use different names for the files where you save the cryptograms as long as they end in .js and that you modify the code going into the head of the individual cryptogram pages to reference the appropriate files you have created.

The next step is to get the main cryptogram head script so that we can add both scripts into the head of our page.

See More About

©2016 About.com. All rights reserved.