JavaScript code can
be included in (or referenced from) HTML pages, and it can execute when the page loads or
when certain events on the page happen (such as a button being clicked). Some of the first
uses of JavaScript were to add (more or less) useful graphical effects to web pages (remember
the falling snow and the flying bats?), but in the meantime both the language and the skills
(and tastes) of the people using it have improved.
Although familiarity with JavaScript will certainly help you, we??™ll teach you everything you
need to improve your shop. For a comprehensive JavaScript reference, you should check out
JavaScript: The Definitive Guide (David Flangan. O??™Reilly, 2006.) or check one of the several
free tutorials on the Web, such as those at these URLs:
??? http://www.echoecho.com/javascript.htm
??? http://www.webteacher.com/javascript/
??? http://www.w3schools.com/js/default.asp
??? http://en.wikipedia.org/wiki/JavaScript
User Web
Client
Client requests a PHP page
JavaScript code makes
invisible call to server
Server replies by sending the data
Server executes the PHP page
and builds an HTML response
JavaScript updates the
web page using this data
The server sends a response
containing HTML and JavaScript
Web
Server
CHAPTER 13 ?– IMPLEMENTING AJAX FEATURES 400
DOM
The DOM is an application programming interface (API) that allows for reading and manipulating
hierarchical structures such as HTML and XML documents.
Pages:
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512