Download e-book for iPad: Advanced Javascript by Chuck Easttom

Both scripts produce the output shown in Figure 2-1. Figure 2-1. An alert box When you press the OK button, you are taken to the image shown in Figure 2-2. Figure 2-2.

Effects such as image rollovers are common on many web sites. You will see later in this book just how easy these are to implement in JavaScript. Games You can create many interesting games with JavaScript. During our JavaScript programming experience we have written tic-tac-toe games, a mastermind game, a Tetris game, and many others. There are basically two types of games you can create via JavaScript: n Static games n Dynamic games Static games are usually logical ones, and thus do not require much action or immediate responses.

Some commonly used event handlers include onMouseOver, onMouseOut, onLoad, onSubmit, and onClick. Like any other HTML tag attribute, event handlers belong inside an HTML tag, are followed by an equal sign, and contain their values in quotes. The difference is that the event handler’s value is JavaScript. gif'" > You will see event handlers used in this manner quite frequently. It is a very popular technique with JavaScript programmers. Short Statements Short statements are just like what you saw in event handlers.

Download PDF sample

Advanced Javascript by Chuck Easttom


by Michael
4.5

Rated 4.62 of 5 – based on 42 votes