Page Glossary | JavaScriptSource

Page Glossary

Aaron Gustafson Jun 6, 2008

General

This script collects all of the abbreviations, acronyms, and definitions on a page and builds a definition list of the terms, which is appended to a specified container. The script checks for duplicate terms and also alphabetizes the terms.


Lorem ipsum Internet Explorer dolor sit amet, consectetuer adipiscing elit 18 kB, sed diam nonummy nibh euismod tincidunt ut laoreet HTML dolore magna aliquam erat volutpat.

Notes

In the last section of the script, the ids for the content and glossary are given, in this example they are 'content' and 'extras'. The script will process the abbreviations, acronyms, and definitions contained in the 'content' id and then place them within the 'extras' id.

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: pageGlossary.js


CSS

Paste this code into your external CSS file or in the <style> section within the HEAD section of your HTML document.


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


Leave a Response

(0 comments)