O'Reilly logo

Web Design in a Nutshell, 2nd Edition by Jennifer Niederst Robbins

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 28. Introduction to JavaScript

JavaScript is a client-side scripting language that adds interactivity to web pages and lets designers control various aspects of the browser itself. With JavaScript, you can do such things as display additional information about links, create mouse rollover effects, change the contents of pages based on certain conditions, randomly display content on a page, load content in new browser windows and frames, and (with some help from CSS) move elements around on the page.

A scripting language is somewhere between a markup language, like HTML, and a full-blown programming language, like Java. With JavaScript, you can add extra functionality to your web site using short snippets of scripting code that has a syntax that’s fairly easy to understand.

This chapter includes material and code by Nick Heinle and Bill Peña, authors of Designing with JavaScript (O’Reilly). For a more advanced JavaScript reference, see JavaScript: The Definitive Guide by David Flanagan (O’Reilly). Also note that for simple functionality, you may not need to write your own JavaScript at all; software like Macromedia’s Dreamweaver can do the coding for you, with built-in behaviors you can drop in like HTML objects. But as with HTML, if you are going to use JavaScript, you should be familiar with the basics of the language, whether you are using a WYSIWYG editor or not.

JavaScript History

JavaScript was first introduced by Netscape in Navigator 2.0, as a simple scripting 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