Customer Service 1-800-221-5528

Murach’s JavaScript and jQuery (4th Edition)

by Mary Delamater and Zak Ruvalcaba
19 chapters, 711 pages, 289 illustrations
Published September 2020
ISBN 978-1-943872-62-6
List price: $59.50

Today, every web developer has to know JavaScript. And this book helps you teach JavaScript to your students in a way that also lets them take advantage of jQuery, the classic JavaScript library that’s used in the majority of websites large and small.

This latest edition includes two new chapters on using (1) the Fetch API and promises with Ajax and (2) Node.js for server-side JavaScript. It’s thoroughly updated to modern ECMAScript and today’s best practices. It’s filled with coding examples to ensure that your students learn the skills that are actually used on the job. And it uses a didactic approach that works, whether or not your students have taken a programming course before.

Now available as a Canvas course!

The Canvas course file contains all the objectives, quizzes, assignments, and slides that you need to run an effective course. It only takes a few clicks to import it into the Canvas LMS. Then, you can customize it for your course. Learn more.

Your books are so good that I threw away my assigned JavaScript and jQuery book for my class and bought Murach’s JavaScript and jQuery (which has, by the way, helped restore my 4.0 GPA).”

Blaine Simcox, Student, Michigan

  • About this Book
  • Table of Contents
  • Courseware
  • FAQs
  • Corrections

Book description

To present the JavaScript and jQuery skills that your students need in a manageable progression, this book is divided into 4 sections, representing the levels of expertise that your students will achieve.

Section 1: JavaScript essentials

  • Section 1 presents a 7-chapter course in JavaScript that gets your students off to a great start. This section works for programming beginners as well as for students with some programming experience because the pace is adjustable. Beginners can move through the material slowly and do all the exercises. Students with some programming experience can move more quickly and do just the exercises that you assign.
  • Either way, when they finish this section, your students will be developing real-world JavaScript applications of their own. They will also have all of the skills that they need for using jQuery. This will put your course far ahead of what you can accomplish with competing books.

Section 2: The jQuery essentials

  • In this section, your students will learn how to use jQuery to create JavaScript applications like image swaps, collapsible panels, slide shows, carousels, user-friendly forms…and more.
  • To begin, chapter 8 presents the jQuery selectors, methods, and event methods that are used the most. Then, the next 3 chapters build on that base as they focus on the use of effects and animations, forms and data validation, jQuery plugins, and jQuery UI widgets.
  • Because chapter 8 covers all of the key jQuery features, you can go on to any of the other 3 chapters…or to any chapter in sections 3 and 4…once you’ve finished chapter 8.

Section 3: More JavaScript skills

  • After your students finish sections 1 and 2, they will have the JavaScript and jQuery skills that every web developer can benefit from. That by itself is a complete JavaScript and jQuery course.
  • But if your course has time for more, the 5 chapters in section 3 will let your students build out those skills and add new ones. They’ll learn more about how to work with numbers, strings, and dates...how to handle exceptions and use regular expressions...when and how to use browser objects, cookies, web storage, arrays, and maps...and how to create and use their own objects.
  • All of the coding examples in this section show how to use JavaScript with jQuery. Because that’s the way applications are so often coded in the real world, this is a great way to learn the advanced JavaScript skills.

Section 4: Take it to the next level

  • If you have time, the 3 chapters in section 4 will raise your student’s JavaScript skills to a new level of expertise. You can teach any of these once you’ve finished chapter 8 in section 2.
  • These chapters show how to work with closures, the module pattern, and ES modules…how to use the Fetch API and Promise objects to work with Ajax to asynchronously update a web page…and how Node.js allows you to use JavaScript for server-side scripting.

What's NEW in this edition

  • All chapters have been thoroughly updated to use modern ECMAScript and today’s best coding practices. For example, you’ll find:
    • Use of the let and const keywords instead of the var keyword wherever that improves the code
    • Use of arrow functions instead of function expressions for more concise code that also gets rid of the confusing and error-prone this keyword
  • New coverage of the popular Visual Studio Code text editor in place of Brackets
  • New coverage of sets and maps
  • New coverage of using classes to create JavaScript objects
  • New coverage of ES modules
  • A new chapter on using Ajax with the Fetch API and Promise objects
  • A new chapter that introduces server-side scripting with JavaScript using Node.js

Why this is the right book for any JavaScript course

If you’re teaching a JavaScript course that includes jQuery, there’s no better option than this book. It integrates jQuery with JavaScript in a way that you won’t find anywhere else.

Beyond that, though, our book is designed in a way that makes it adaptable for any type of JavaScript course. For instance, here’s how our book can work for some common variations of JavaScript courses:

JavaScript as a first programming course

Because section 1 is designed for students without any programming experience, this book can be used for a first programming course. Then, after your students complete that section, you can take them as far as time permits by assigning chapters from sections 2, 3, and 4.

When you plan your course, keep in mind that only the first chapter in the jQuery section is required. After that, you can assign the chapters in sections 2-4 that are most appropriate for your students and your course.

JavaScript and jQuery for web designers

The first two sections of this book present the concepts and skills that every web designer should at least be aware of. So if your course is for web designers, you can start with section 1, which is designed to work for non-programmers.

Then, you can add chapters from the jQuery section because they show how to implement the common features of today’s websites.

If you still have time, you can finish the course with selected chapters from section 3 or 4. For instance, the chapter on browser objects, cookies, and web storage presents concepts that all web designers should be aware of. The chapter on Ajax shows how to handle asynchronous programming, a must for web developers. And Node.js is a great way to introduce web designers to server-side scripting.

JavaScript for CIS or CS majors with programming experience

If your students have experience with another language, they should move quickly through section 1 of our book. They will find, however, that JavaScript has some intricacies that aren’t found in other languages, so they will still be challenged.

Then, you can assign all of the chapters in the jQuery section. Or, if you want your course to focus more on JavaScript than jQuery, you can assign just the first chapter in that section plus selected chapters of your own choosing.

In other words, once your students have completed chapters 1-8, you can start working your way through the chapters in sections 3 and 4, either in sequence or by creating a sequence that will be a better fit for your course. If your students successfully complete all of these chapters, they will reach a professional level of expertise.

What software your students need

To develop JavaScript applications, your students need:

  • A text editor: This book recommends Visual Studio Code because it’s free and provides many excellent features for developing JavaScript applications.
  • A modern web browser: This book recommends Google Chrome because it provides excellent developer tools for debugging JavaScript applications.

To help your students install these products, Appendix A provides the procedures that they will need on a Windows system, and appendix B provides macOS procedures. In addition, chapter 1 presents a short tutorial on using Visual Studio Code, and chapter 5 shows how to use Chrome for debugging.

Related books

HTML and CSS

Murach's HTML and CSS begins by presenting an eight-chapter crash course that teaches your students HTML and CSS at a professional level, including a chapter on Responsive Web Design. That’s followed by three sections that can be taught in whatever sequence works best for your course.

So, if your students take an HTML and CSS course before they take the JavaScript course, we hope you’ll consider using both of our books for the series. They’re designed to work together seamlessly in a two- or three-course sequence. They both use our unique didactic methods so your students will learn more in less time. And they teach your students the most important HTML, CSS, and JavaScript skills that are actually used on the job.

Murach’s Modern JavaScript

This book helps your students learn JavaScript more easily than ever by presenting the best practices of modern JavaScript. If you don’t need to teach jQuery, we recommend using this book.

What people say about this book

“I have several books on JavaScript, but the best one is this one. The text, examples, descriptions, and even the layout all bring you, the learner, an ease of use that is missing in other books.”
- Chris Wallace, Denver Visual Studio User Group

“If you are new to web design or an old pro like me, this book is a must-have in my opinion. I love how it starts out with the basics and then moves on to the good stuff. Each chapter is full of examples and sample code showing you how to do the most common techniques that you will face as a web developer/designer.
     “I have not seen a better book on the subject. This one will be on my desk for a while!”
- Web Developer, Colorado

From Dr. Dobb’s Must-Have Books for JavaScript: “The aim of the book is to teach jQuery in an intensely hands-on way. It succeeds in this and probably provides the fastest way to learn and master the framework.”
- Andrew Binstock, Editor-in-Chief, Dr. Dobb’s Journal

“An essential characteristic of this book, as well as the other Murach books, is that the examples, programs, and applications are all thoroughly tested. This book will work WONDERFULLY to help you build better and more robust websites!”
- Marvin Schneider, Instructor, New York

“I just finished a pretty heavy application project, the first serious work I have done with jQuery and Ajax. Along the way, I had to deal with preloading images, manipulations of the DOM, tabs, plugins, and Dialogs…. I kept this book at my side throughout the entire project, and it was indispensable. The answers were right there at every turn. All the examples made sense to me, and they all worked!”
- Alan Vogt, ETL Consultant, Information Builders, Inc.

“What I like about this and other Murach books is that within minutes of opening the book, you are developing hands-on with the technology in question.”
- Charles Zimmerman, Developer

 

To view the table of contents for this book in a PDF, just click on the link below:

Table of Contents

Section 1 JavaScript essentials

Chapter 1 Introduction to web development

How a web application works

The components of a web application

How static web pages are processed

How dynamic web pages are processed

How JavaScript is used for client-side processing

How the ECMAScript specification works

The version history of ECMAScript

Browser support for ECMAScript

The components of a JavaScript application

The HTML

The CSS

The JavaScript

The HTML skills that you need for this book

How to use the HTML5 semantic elements

How to use the div and span elements

How to use the basic HTML attributes

The CSS skills that you need for this book

How to provide the CSS styles for an HTML page

How to code the basic CSS selectors

How to code CSS style rules

How to test a JavaScript application

How to run a JavaScript application

How to find errors in your code

How to use Visual Studio Code to develop JavaScript applications

How to work with folders

How to work with files

How to edit a JavaScript file

How to install the Open in Browser extension

How to open an HTML file in a browser

Chapter 2 Get started fast with JavaScript

How to include JavaScript in an HTML document

How to use the script element

How to use the noscript element

The JavaScript syntax

How to code JavaScript statements

How to create identifiers

How to use comments

How to work with data

The primitive data types

How to declare and initialize variables and constants

How JavaScript handles variables and constants

How to work with expressions

How to code arithmetic expressions

How to use arithmetic expressions in assignment statements

How to concatenate strings

How to include special characters in strings

How to use objects, methods, and properties

Introduction to objects, methods, and properties

How to use the parseInt() and parseFloat() methods of the window object

How to use the write() method of the document object

How to use the toFixed() method of a Number object

Two illustrative applications

The Miles Per Gallon application

The Test Scores application

Chapter 3 The essential JavaScript statements

How to code conditional expressions

How to use the relational operators

How to use the logical operators

How to code the basic control statements

How to code if statements

How to code while and do-while loops

How to code for loops

Three illustrative applications

The enhanced Miles Per Gallon application

The Future Value application

The enhanced Test Scores application

How to work with arrays

How to create and use arrays

How to use for loops to work with arrays

How to use for-in and for-of loops to work with arrays

The Test Scores application with an array

The user interface

The JavaScript

Chapter 4 How to work with JavaScript objects, functions, and events

How to use objects to work with data

An introduction to JavaScript objects

How to use the window object

How to use the document object

How to use Textbox and Number objects

How to use Date and String objects

How to use functions

How to create and call a function declaration

How to create and call a function expression

How to create and call an arrow function

How to work with global, local, and block scope

How to handle events

How to attach an event handler to an event

How to use anonymous functions with event handlers

How to work with the Event object

Two illustrative applications

The Miles Per Gallon application

The Email List application

Chapter 5 How to test and debug a JavaScript application

An introduction to testing and debugging

The three types of errors that can occur

Common JavaScript errors

How to plan the test runs

How to debug with Chrome’s developer tools

How to use Chrome to find errors

How to use breakpoints and step through your code

Other debugging methods

How to trace the execution of your JavaScript code

More methods for tracing execution

How to view the HTML and CSS for a web page

Chapter 6 How to script the DOM with JavaScript

DOM scripting properties and methods

DOM scripting concepts

The properties of the Node interface

The methods of the Document and Element interfaces

The properties of the DOM HTML specification

The classList property of the Element interface

The FAQs application

The HTML

The CSS

The JavaScript

How to script forms and controls

How forms work

How to script Textbox, Textarea, and Select objects

How to script Radio and Checkbox objects

How to use the methods and events for forms and controls

The Register application

The HTML

The JavaScript

How to modify the DOM

How to create, add, replace, and delete nodes

The updated Register application

Chapter 7 How to work with images and timers

How to work with images

How to create an HTMLImageElement object

How to preload images

The Image Swap application

The HTML and CSS

The JavaScript

How to use timers

How to use a one-time timer

How to use an interval timer

The Slide Show application

The HTML and CSS

The JavaScript

Section 2 jQuery essentials

Chapter 8 Get off to a fast start with jQuery

Introduction to jQuery

What jQuery is

How jQuery can simplify JavaScript development

The basics of jQuery

How to include jQuery in your web pages

How to code jQuery selectors

How to call jQuery methods

How to use jQuery event methods

The Email List application

The user interface and HTML

The JavaScript and jQuery

More skills for working with jQuery

The most useful selectors

The most useful methods

The most useful event methods

Other event methods that you should be aware of

Three illustrative applications

The FAQs application

The Image Swap application

The Image Rollover application

Chapter 9 How to use effects and animations

How to use effects

The jQuery methods for effects

The FAQs application with jQuery effects

A Slide Show application with effects

The user interface, HTML, and CSS

Two ways to code the jQuery

How to stop and start a slide show

How to use animation

How to use the basic syntax of the animate() method

How to chain animate() methods

How to use the delay(), stop(), and finish() methods

How to use easings with effects and animations

How to use the advanced animate syntax and the methods for working with queues

A Carousel application with animation

The user interface, HTML, and CSS

The JavaScript and jQuery

Chapter 10 How to work with forms and data validation

Introduction to forms and controls

How forms work

The HTML5 controls for working with forms

The HTML5 and CSS3 features for data validation

How to use jQuery to work with forms

The jQuery selectors and methods for forms

The jQuery event methods for forms

A Validation application

The user interface and HTML

The JavaScript and jQuery

Chapter 11 How to use jQuery plugins and UI widgets

Introduction to jQuery plugins

How to find jQuery plugins

How to use any jQuery plugin

How to use three of the most popular plugins

How to use the Lightbox plugin for images

How to use the bxSlider plugin for carousels

How to use the Cycle 2 plugin for slide shows

Introduction to jQuery UI

What jQuery UI is and where to get it

How to download jQuery UI

How to include jQuery UI in your web pages

How to use any jQuery UI widget

How to use five of the most popular jQuery UI widgets

How to use the Accordion widget

How to use the Tabs widget

How to use the Button and Dialog widgets

How to use the Datepicker widget

Section 3 Advanced JavaScript skills

Chapter 12 How to work with numbers, strings, and dates

How to work with numbers

How to use the properties of the Number object

How to use the methods of the Number object

How to use the properties and methods of the Math object

How to generate a random number

The PIG application

The CSS

The HTML

The JavaScript

How to work with strings

How to use the properties and methods of the String object

More methods of the String object

How to create an array from a string

How to work with dates and times

How to create Date objects

How to use the methods of the Date object

Examples of working with dates

The Count Down application

The HTML and CSS

The JavaScript

The Internationalization API

How to format numbers

How to format dates

Chapter 13 How to work with control structures, exceptions, and regular expressions

What else you need to know about control structures

How to use the equality and identity operators

How to use the break and continue statements

How to use the switch statement

How to use the conditional operator

How to use non-Boolean values in conditions

Additional techniques for using the logical operators

The Invoice application

The HTML

The JavaScript

How to handle exceptions

How to use try-catch statements

How to create and throw Error objects

How to use regular expressions

How to create and use regular expressions

How to match special characters and types of characters

How to match string positions, subpatterns, and repeating patterns

Regular expressions for data validation

The Account Profile application

The HTML

The JavaScript

Chapter 14 How to work with browser objects, cookies, and web storage

How to script browser objects

How to use the location object

How to use the history object

The Tutorial application

The HTML

The JavaScript

How to use cookies

An introduction to cookies

How to create cookies

How to read cookies

How to delete cookies

The Task List application

The HTML and CSS

The JavaScript

How to use web storage

How to use local and session storage

The Task List application with web storage

How to use Chrome with cookies and web storage

How to work with cookies

How to work with web storage

Chapter 15 How to work with arrays, sets, and maps

How to create and use an array

How to create an array

How to add and delete array elements

How to use for, for-in, and for-of loops with arrays

How to destructure an array

How to use the methods of the Array type

Methods that add, modify, remove, and copy elements

Methods that inspect an array or its elements

Methods that transform the elements

The Test Scores application

The HTML

The JavaScript

More skills for working with arrays

How to split a string into an array

How to make a copy of an array

How to create and use an associative array

How to create and use an array of arrays

How to convert an array to JSON and back

The Task List application

The HTML

The JavaScript

How to work with sets and maps

How to create and use a set

How to create and use a map

Chapter 16 How to work with objects

Basic skills for working with objects

How to create object literals

More skills for coding methods and properties

How to extend or modify an object

How to work with accessor properties

How to create and use JavaScript libraries

The Miles Per Gallon application

The HTML

The JavaScript

How to work with classes

How to use a class to define an object type

How to use inheritance

When to use inheritance

When to use object composition

The Trips application

The HTML and CSS

The JavaScript

How to work with prototypes

An introduction to prototypes

Legacy code for creating objects

More skills for working with objects

How to use a symbol as a computed property or method name

How to work with iterators

How to work with generator functions

How to create cascading methods

How to destructure an object

An introduction to the static methods of the Object type

The Task List application

The HTML and CSS

The JavaScript

Section 4 Take it to the next level

Chapter 17 How to work with functions, closures, and modules

Basic skills for working with functions

How to create a function

How to work with default parameters

How to use the rest and spread operators

How to work with the this keyword

The Test Scores application

The HTML and CSS

The JavaScript

How to work with closures

An introduction to closures

How to use closures to create private state

How to work with the this keyword in closures

The Slide Show application

The HTML

The JavaScript

How to work with the module pattern

How to code an IIFE

How to use the module pattern and namespaces

How to work with ES modules

How to import and export module items

How to declare a script as a module

More skills for working with modules

The Slide Show 2.0 application

The HTML

The JavaScript

Chapter 18 How to work with Ajax

Introduction to Ajax

How Ajax works

Two common data formats for Ajax

The JSON Placeholder API

How to make a single Ajax request

How to use the XMLHttpRequest object

How to use the Fetch API

The Astronomy Picture Of the Day application

The HTML and CSS

The NASA APOD API

The JavaScript

How to make multiple Ajax requests

The XMLHttpRequest object and “callback hell”

How the Fetch API solves “callback hell”

How to use named callback functions

How to handle errors

The Photo Viewer application

The HTML and CSS

The JavaScript

More skills for working with promises

How to create and use your own Promise objects

Static methods of the Promise type

How to use the async and await keywords

How to work with for-await-of loops

The updated JavaScript for the Photo Viewer application

How to make cross-origin requests

An introduction to Cross Origin Resource Sharing

How to handle CORS issues with APIs

Chapter 19 How to work with Node.js

An introduction to Node.js

When to use Node.js

How to install Node.js

How to use the node command

How to interactively test code

How to run a script

How to pass arguments to a script

How to work with Node.js modules

An introduction to modules

How to use the built-in file system module

How to use the built-in file system module with promises

How to create and use your own module

How to use NPM to install modules

An introduction to NPM

How to install and use the http-server module

How package.json files work

Resources

Appendix A How to set up Windows for this book

How to install the source code for this book

How to install Chrome

How to install Visual Studio Code

Appendix B How to set up macOS for this book

How to install the source code for this book

How to install Chrome

How to install Visual Studio Code

If you aren’t familiar with the supporting materials that we provide for our books, please go to About our Courseware. That will give you a good overview of what we provide and how each component can work for you and your students.

If you’re already familiar with our supporting materials from other books, here’s a quick summary of the courseware for this book. For a detailed description in PDF format, please read the Instructor’s Summary.

End-of-chapter activities in the book

  • Terms list
  • Chapter summary
  • Exercises

Student download at our retail site

  • Source code for the applications presented in the book
  • Starting source code for the exercises at the end of each chapter, including the HTML and CSS files that provide the user interface
  • Solutions to those exercises, so your students won’t get hung up by trivial errors as they work on their own

Appendixes A and B in the book give your students instructions for downloading and installing these items on Windows or macOS.

Instructor’s materials

  • Instructional objectives by chapter
  • PowerPoint slides
  • Test banks
  • Extra chapter exercises and their solutions...your students won’t have the solutions for these exercises
  • Short exercises that can be used for added practice, quizzes, or tests
  • 3 case studies that provide more extensive practice and can be used as midterm or final projects

To view the "Frequently Asked Questions" for this book in a PDF, just click on this link: View the questions

Then, if you have any questions that aren't answered here, please email us. Thanks!

To view the corrections for this book in a PDF, just click on this link: View the corrections

Then, if you find any other errors, please email us so we can correct them in the next printing of the book. Thank you!

Murach college books and courseware since 1974