Introduction
Not too long ago, the Web was a pretty boring place. Constructed from plain old HTML, Web pages displayed information and not much else. Folks would click a link and then wait for a new Web page to load—and that was about as interactive as it got.
These days, most Web sites are almost as responsive as the programs on a desktop computer, reacting immediately to every mouse-click. And it’s all thanks to the subject of the book you’re holding—JavaScript.
What Is JavaScript?
JavaScript is a programming language that lets you supercharge your HTML with animation, interactivity, and dynamic visual effects.
JavaScript can make Web pages more useful by supplying immediate feedback. For example, a JavaScript-powered shopping cart page can instantly display a total cost, with tax and shipping, the moment a visitor selects a product to buy. JavaScript can produce an error message immediately after someone attempts to submit a Web form that’s missing necessary information.
JavaScript’s main selling point is its immediacy. It lets Web pages respond instantly to the actions of someone interacting with a page—clicking a link, filling out a form, or merely moving the mouse around the screen. JavaScript doesn’t suffer from the frustrating delay associated with server-side programming languages like PHP, which rely on communication between the Web browser and the Web server. Because it doesn’t rely on constantly loading and reloading Web pages, JavaScript lets you create Web pages that feel ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access