Please note: This website is an archive of ghscc.com. It is no longer updated.

GHS Computer Club

Font: Serif | Sans-Serif || Tiny | Small | Normal | Large | Huge

JavaScript on GHSCC.com

Accessible, Convenient JavaScript (ECMAScript)

JavaScript: What is it?

JavaScript is a programming language used to write scripts for use in web pages.  All modern graphical browsers support it to some degree.

JavaScript is officially called ECMAscript and not at all related to Java, a programming language originating at Sun.  Because webmasters love acronyms, it is often abbreviated JS.

Why JavaScript?

We use JavaScript because it allows us to do several nifty things right in your browser.  Using it often allows us to skip a page reload.  Who likes page reloads?

You can find JavaScript in any links that change the appearance of the page in minor ways.  Examples include the font-size and font-type changers and the hide-right-column link, if it is available.  Another use of JavaScript is to remove default text from text (“input”) boxes.

Accessible JavaScript!

Some people can’t or don’t use JavaScript.  Who?  The list includes someone surfing the Web on a cell phone or with a text-based browser, and the very security-conscious (some would say paranoid).  Other people cannot use a mouse, such as people with disabilities and blind users.  For these people we have made JavaScript links “fall back” to regular links whenever possible.  If you disable JavaScript and change the font size, the page is reloaded from our server with the new font size, completely without JavaScript.  The ability to do any important thing that a JS-enabled user can – without a mouse or without JavaScript– is what we call accessibility (in this case).

A resource that I (Alan) found extremely useful when making GHSCC.com accessible was WebAIM’s guide to writing accessible JavaScript.  If you are a webmaster or web developer working with JS, consider it required reading.  You will also want to use the principles outlined in Accessible Pop-Up Links on A List Apart and Using Real Links from Dive Into Accessibility.  I know I did.

I don’t have JavaScript!

As of this writing, there may be a few things that you cannot do without JavaScript; however, you should still be able to use the website.  For example, in one skin, you may not be able to hide the right column if you cannot use JavaScript.  (It should, however, still be accessible without a mouse.)

But does GHSCC use AJAX?

(Note: AJAX is mostly beyond the scope of this article.)  Depends on whether you believe that AJAX, or “Asynchronous JavaScript And XML” necessarily uses non-fragmented XML.  (Jesse James Garrett, coiner of the term “AJAX”, says it doesn’t.)  As of this writing, GHSCC server responses are either plain text are fragments of XHTML (not a whole document).  We may still refer to it as AJAX because it sounds friendlier than XMLHTTPRequest.

Whoa! That went right over my head.

Sorry.  For all practical purposes, yes, we use AJAX.  For example, when you use JS to change the font size, we make an AJAX (background) call to our server, saying, “Hey, this user likes <large> font sizes,” or something to that effect.  The server remembers your preference and applies it to any other pages you visit on our website!

Wow. That’s pretty cool. I think I learned something.

Great.  If you have any questions on how this website uses JavaScript, contact us below.









Valid XHTML 1.0!

Valid CSS!

this page

Written by Alan Hogan on 2005-12-10; viewed 825 times.

Last revised: 2009-04-09 by Alan Hogan. See all.

www.ghscc.com

Read our privacy policy. Contact the GHS Computer Club.

This page is automatically printer-friendly. Just click your Print button!