13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

190<br />

Figure 8-3. The alert placeholder in action<br />

From pseudocode to real code<br />

Having set out the steps required to make this work, let’s take a look at the actual code that will do it (I’ll quote from my<br />

earlier descriptions):<br />

“The browser begins loading the page, and includes a piece of JavaScript in an external .js file that contains all the behavioral<br />

rules.”<br />

In the previous examples, I showed the scripts embedded in the page itself. It’s now time to place the scripts in their own file<br />

and refer to them in the web page, like so:<br />

<br />

<br />

<br />

A sectioned-up page<br />

<br />

<br />

...<br />

“When the page has loaded . . .”

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!