22.04.2013 Views

HTML, XHTML & CSS

HTML, XHTML & CSS

HTML, XHTML & CSS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

In This Chapter<br />

Chapter 13<br />

Scripting Web Pages<br />

▶ Exploring what JavaScript can do for your Web pages<br />

▶ Arranging content<br />

▶ Opening new windows<br />

▶ Checking user input<br />

▶ Exploring more uses for JavaScript<br />

When used in conjunction with your <strong>HTML</strong> markup, scripts — small<br />

programs that you add to your Web page — help your Web pages<br />

respond to user actions. Scripts create the interactive and dynamic effects<br />

you see on the Web, such as images that automatically change when visitors<br />

move mouse pointers over them, additional browser windows that pop up<br />

when a page loads, and animated or interactive navigation bars.<br />

Because scripts are mini-programs, they’re often written in a programming<br />

language called JavaScript. If you’re unfamiliar with the term, JavaScript may<br />

sound like a Hollywood screenplay doused with coffee. However, it is actually<br />

a scripting language built right into all popular Web browsers.<br />

Fortunately, because of the Nobel Prize–worthy invention of “copy and<br />

paste,” you don’t need to be a technoguru to add scripting to your Web sites.<br />

The Web has many sites that feature canned JavaScript elements that you<br />

can freely copy and then paste right into your Web page. (Chapter 14 lists<br />

several of the best JavaScript sites.)<br />

Many good Web page editors (such as Adobe Dreamweaver and Adobe<br />

Fireworks) include built-in tools to help you create scripts — even if you<br />

don’t know anything about programming.<br />

In this chapter, you explore how scripting works inside your Web page by<br />

dissecting three sample scripts written in JavaScript. If you’re interested in<br />

learning more about JavaScript and how it works, please check out JavaScript<br />

For Dummies, 5th Edition, by Emily Vander Veer, for more information and to<br />

dive a little deeper into the JavaScript language itself.

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

Saved successfully!

Ooh no, something went wrong!