Script

How JavaScript is used on this website.

Introduction

The HTML snippets seen on the Template and Content pages call JavaScript routines and hint at what the scripts do. This page will give you more information. It does not go into depth on how JavaScript works nor teach JavaScript programming. The following is just a site specific overview.

Warning

The JavaScript on this website is mostly written by me. You are welcome to use, adapt and improve it. I don't accept responsibility if you do. It works on the latest versions of Internet Explorer and usually on Mozilla Firefox in PC Windows. It is not cross-browser or cross platform compatible and probably degrades disgracefully. My excuse is that almost all the ex-members use IE4 or later and there are too many good things in the Document Object Model (DOM) to waste.

Locations

There are hundreds of pages on the website that all use the same JavaScript functions. Therefore they all refer to one file that holds the majority of the scripts - "common.js".

Variables that frequently need to be added or updated such as latest pages, events and star ratings are put in a smaller "data.js" file.

Functions specific to one section of the site are in "standard.js" in the section folder.

When only one page uses a special function it is placed in the HTML page. For example the Ex-member pages have functions to write page content (based on data held in "xmem.js")

Types of functions.

Before and while loading
  1. An error trap to reduce error messages if the script fails. (An admission of defeat!)
  2. Write 'includes' that write standard parts of the pages such as the menus and star ratings
  3. Create layers for right click menu, tooltips and a few pop-up photos.
Straight after loading
  1. Put tooltip contents wherever ex-members' names occur.
  2. Mark any links to pages.
  3. Get a list of the names of people in photographs.
  4. Disable links to the same page.
Events as a result of viewer action
  1. Show tooltips
  2. Pop up comment forms and other information windows. See the Security help page.
  3. Provide keyboard shortcuts for navigation.
  4. Swap and zoom images.
Other items
  1. Constants such as date related values.
  2. Current page information.
  3. Databases of members, star ratings, new pages, venues of forthcoming meetings.
Cookies
  1. Session cookies that reside in memory as long as you are on the site and then are forgotten.
  2. Site cookies that only this website can write or read. You can alter your browser options to warn you before cookies are set, or block cookies or only permit cookies from specified sites.

LPMCC.net depends on JavaScript to display the navigation, page structure and a lot of other features. It is possible for you to turn JavaScript off if you wish to. JavaScript is pretty harmless and cannot do the kind of harm that Java or Active-X controls are capable of. Maybe Microsoft is trying to scare people out of using JavaScript with tales of malicious code because they do not get royalties from its use.

If you do turn JavaScript off you will certainly know. See the Security help page.