We can add any JavaScript that we like to a web page in an unobtrusive way. The hangman game script allows you to add a game to your web page. You do need to use the form provided here to generate a second script containing your answers first before installing the script as the script "encrypts" the answers to stop people cheating by viewing the source.

This script can be added unobtrusively to any web page simply by including the appropriate two script tags and link tag in the head of your page in order to link the JavaScript and stylesheet to your page. The only other change needed is to add an empty div tag with id="hang" in the spot where you want the game to appear.

Download a complete copy of the hangman game including sample HTML that shows you how to attach this unobtrusive JavaScript into your page.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow