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 ...
Get Web Design in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.