Topics In This Book
Chapter 1: The ABC of Programming
Chapter 3: Functions, Methods & Objects
Chapter 4: Decisions & Loops
Chapter 5: Document Object Model
Chapter 6: Events
Chapter 7: jQuery
Chapter 8: Ajax & JSON
Chapter 9: APIs
Chapter 10: Error Handling & Debugging
Chapter 11: Content Panels
Chapter 12: Filtering, Searching & Sorting
Chapter 13: Form Enhancement & Validation
Chapter 5 explains how the Document Object Model (DOM) lets you access and change a document’s contents while it is loaded into the browser.
Chapter 6 discusses how events can be used to trigger code.
Chapter 7 shows you how iQuery can make the process of writing scripts faster and easier.
Chapter 8 introduces you to Ajax, a set of techniques that allow you to just change part of a web page without reloading the entire page.
Chapter 9 covers Application Programming Interfaces (APIs), including new APIs that are part of HTML5 and those of sites like Google Maps.
Not only will you see a selection of in-depth examples, you will also learn more about the process of designing and writing scripts from scratch.
Chapter 11 shows you techniques for creating content panels such as sliders, modal windows, tabbed panels, and accordions.
Chapter 12 demonstrates several techniques for filtering and sorting data. This includes filtering a gallery of images, and re-ordering the rows of a table by clicking on the column headings.
Chapter 13 deals with form enhancements and how to validate form entries.
Unless you are already a confident programmer, you will probably find it helpful to read the book from start to finish the first time. However, once you have grasped the basics, we hope it will continue to be a helpful reference as you create your own scripts.
Consider how you might approach a different type of script. This example calculates the cost of a name plaque. Customers are charged by the letter.
The first thing you should do is detail your goals for the script (what you want it to achieve):
Customers can have a name added to a plaque; each letter costs $5. When a user enters a name, show them how much it will cost.
Next, break it into a series of tasks that have to be performed in order to achieve the goals:
- The script is triggered when the button is clicked.
- It collects the name entered into the form field.
- It checks that the user has entered a value.
- If the user has not entered anything, a message will appear telling them to enter a name.
- If a name has been entered, calculate the cost of the sign by multiplying the number of letters by the cost per letter.
- Show how much the plaque costs.
(These numbers correspond with the flowchart on
the right-hand page.)
|No. of Pages||583|
|PDF Size||97.3 MB|