O'Reilly logo

Creating a Website: The Missing Manual, 3rd Edition by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15. JavaScript: Adding Interactivity

JavaScript is a simplified programming language designed to beef up web pages with interactive features. It gives you just enough programming muscle to add some fancy effects, but not enough to cause serious damage to your site if your code goes wonky. JavaScript is perfect for creating pop-up windows, embedding animated effects, or modifying the content that appears on your web page. On the other hand, it can’t help you build a hot e-commerce storefront; for that, you need the PayPal tools described in Chapter 14 or a server-side programming platform (see Server-Side and Client-Side Programming).

The goal of this chapter isn’t to teach you the details of JavaScript programming—it’s to give you enough background so you can find great JavaScript code online, understand it well enough to make basic changes, and then paste it into your pages to get the results you want. Since you can find free JavaScript code on hundreds of websites, these basic skills can come in very handy.

Understanding JavaScript

The JavaScript language has a long history; it first hit the scene with the Netscape Navigator 2 browser in 1995. Internet Explorer jumped on the bandwagon with version 3. Today, all modern browsers run JavaScript, and it’s become wildly popular as a result.

Note

JavaScript is thoroughly different from the Java language (although the code sometimes looks similar, because they share some code-writing rules). Java is a full-fledged programming language, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required