What s It All About?


What’s It All About?

Programming for the Web—or in Windows, with a small or big W for that matter—relies on events. You just can’t expect to figure out everything in environments with today’s complexity, so it makes much more sense to create programs that fire events when something happens. These same programs also must respond to, or handle, events as they “come in” if these events are significant to the objects in the program.

JavaScript is a great language for learning to use the events that are provided “ready to wear” by a Web browser when a document is loaded into it. Handling events in this sense, which is a little like a passive partner responding to a more active one and is also a form of what’s called clientserver programming, is pretty much the same in JavaScript as in most other modern programming languages.

There’s a little less capability in the JavaScript language when it comes to registering and firing your own events. But as I showed you in this chapter, you can still use the event model in your own program architecture. In addition, it’s easy and powerful to use timers to create periodic event “simulacrums.” The material in the second half of this chapter should stand you in good stead when you move to a programming language with more advanced event creation facilities.

Learning to program well is largely about string manipulation. (Oddly enough, this is certainly true in a formally reductive sense.) So let’s move on to Chapter 9, “ Manipulating Strings.”




Learn How to Program Using Any Web Browser
Learn How to Program Using Any Web Browser
ISBN: 1590591135
EAN: 2147483647
Year: 2006
Pages: 115
Authors: Harold Davis

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net