About the examples
All the examples are built on the Template.htm (or Template2.htm) page, both of which are bare bones HTML. The two templates are virtually the same intentionally. The second one is for XHTML where XML and HTML may get mixed together. Initially you can ignore the second one.
The aim is keep as much of the code the same as is possible, so it becomes familiar, and minimises changes. You then only need focus on the particular code that's been changed/added for any particular example, and not get distracted by other spurious changes which are not directly relevant.
The templates include a pair of DIV tags with an id = "output". Most the examples will place any output here, so don't delete them! Occasionally other DIV tags may get added as required. Any variations to the basic template should be referenced in the text.
It is assumed you have a good working knowledge of HTML and an appreciation at least of CSS.
Its a good idea to save any variants as separate examples. e.g. HelloWorld.htm, HelloWorld-1.htm, etc. The example, has some brief introductory text. Your are encouraged to add to, or alter this, so it's in your own words. You should do this anyway, to explain the differences between any variants you create.
Likewise the examples are almost devoid of comments and just focus on the bare code. You must however get into the habit of annotating your code. You can't have to few comments, especially when learning and in development! In live versions of your scripts the comments can subsequently be stripped out.
The example page you open will mostly have the example pre-loaded, clicking on the button(s) in the new window to run the particular example code. Its often easier to understand the code, if you can see what is going on.
If after trying to debug the code yourself and get your version working, only then refer to the code in the example window. Compare them to see what the problem is. At least 80% of the time, the problems will be typo's. There is of course the possibility the program in the notes themselves contain a typo, or two in which case we'd appreciate it if you flagged them up.
getElementsById('output'). They also include mismatched quotes.
An essential debugging skill is the ability to read what you actually typed, not what you think, or intended, to type
The form button is typically called run code You can change this to something which more accurately describes the example if you wish. Likewise in many of the examples, the function being tested is called test. Again you can change this to something more appropriate if you wish.
If you decide to combine several functions onto a single page,