Home > Store > Open Source > Ajax & JavaScript

larger cover

Add To My Wish List

Sams Teach Yourself JavaScript in 24 Hours, 5th Edition

Register your product to gain access to bonus material or receive a coupon.

  • Description
  • Downloads
  • Extras
  • Reviews
  • Sample Content

Product Author Bios

Phil Ballard is a professional web consultant specializing in website and intranet design, search engine optimization, server-side scripting, client-side design, and programming and hosting. He has written a number of books and online tutorials, including Sams Teach Yourself Ajax in 10 Minutes.

Michael Moncur is the owner of Starling Technologies, a consulting firm specializing in networking and the Internet. He is also a freelance webmaster and author, and has written books on JavaScript, networking, and MCSE training.

Learn JavaScript in 24 Hours

Covers JavaScript 1.8+, Ajax and jQuery


In just 24 lessons of one hour or less, you can learn how to create dynamic, interactive Web pages with the popular and ubiquitous JavaScript web programming language.


Using a straightforward, step-by-step approach, each lesson in this book clearly and carefully walks you through basic concepts and techniques, and helps you learn the essentials of JavaScript programming from the ground up.


Learn how to…

  • Use JavaScript to build dynamic, interactive Web pages
  • Debug scripts
  • Create scripts that work in all browsers
  • Work with HTML5 and CSS3
  • Leverage the popular jQuery library
  • Control CSS with simple JavaScripts
  • Add Ajax effects to your web pages
  • Script animations and music

Step-by-step instructions carefully walk you through the most common JavaScript programming tasks

Quizzes at end of every chapter help you build and test your knowledge

Interactive online exercises let you practice what you learn at the Codecademy web site with no downloads or installation needed


Sams Publishing has teamed up with Codecademy — the online place where anyone can learn and teach coding — to provide readers of Sams Teach Yoruself JavaScript in 24 Hours with an exclusive area on the Codecademy web site where you can supplement what you've learned in this book with some fun, fully interactive exercises and projects. After reading a lesson in the book you can roll up your sleeves and get some hands-on coding experience at codecademy.com/tracks/teachyourself



Downloads

Download free code files for Sams Teach Yourself JavaScript in 24 Hours here

Customer Reviews

2 of 2 people found the following review helpful
5.0 out of 5 stars Lots of Information, April 6, 2013
This review is from: Sams Teach Yourself JavaScript in 24 Hours (5th Edition) (Paperback)
This book combined with the accompanying resources on Codecademy.com are probably the best combo out there to help you learn Javascript. In addition to the nuts and bolts of Javascript, Sam's Teach Yourself also has a lot of background information and description, which is great if you need it and easy to gloss over if you don't. I certainly wouldn't say I'm an expert on Javascript yet, but I think I've got a fundamental understanding of how it works that I can continue to build on.

The specific companion on Codecademy is at codecademy.com/teachyourself.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


4.0 out of 5 stars Good introduction to client-side JavaScript, March 19, 2013
This review is from: Sams Teach Yourself JavaScript in 24 Hours (5th Edition) (Paperback)
This book gives a good introduction to the client-side JavaScript landscape and guides absolute beginners through a lot of important concepts. I've been writing JavaScript for over 10 years and here are my thoughts:

PROS

- It walks you through all the concepts you'll see in other people's code.
- Concepts build on each other and give you a chance to make working programs in each hour.
- At the end of the book it demonstrates new JavaScript APIs such as <video>, localStorage, Files API, and Drag and Drop.
- It encourages using developer tools such as Firebug and IE Developer Tools.

CONS

- It had a great section on good coding practices (hour 14) but the book would have been much better if it used those best practices from the beginning.
- It spent too much time showing how to make your code cross-browser compatible. It is more effective to teach the standard methods and then advocate using a library like jQuery to... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


3.0 out of 5 stars Learn some JavaScript to Build Web Pages, March 14, 2013
This review is from: Sams Teach Yourself JavaScript in 24 Hours (5th Edition) (Paperback)
If you're looking for a simple and fast way to learn as much JavaScript as needed to add scripts to your web pages, then this may be the book for you. The exposition is clear, the topics are easy to grasp and it'll take even less than the 24 hours promised by the cover. Despite the conversational approach, the book will also make a good reference to keep near your workstation while coding.

The other face of the coin is that advanced topics are not discussed in the book. In fact the discussion of JavaScript as a programming language ends at Hour 9, and the rest of the book is about web development tools and techniques: the DOM, AJAX, JQuery, Firebug, HTML5 APIs and so on...

Also this book is not for those interested in node.js: it only gets mentioned at the end of the book. And client side frameworks to build web apps (like Ember, Backbone and Knockout) are not even mentioned.

The interactive exercises on Codecademy are a very nice addition. They're not... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


Share your thoughts with other customers:
 See all 5 customer reviews...

Online Sample Chapter

Using Functions in JavaScript

Table of Contents

Introduction     1

Who This Book Is For      1

The Aims of This Book      1

Conventions Used      2

Q&A, Quiz, and Exercises      2

How the Book Is Organized      2

Tools You’ll Need      3

PART I: First Steps with JavaScript      5

HOUR 1: Introducing JavaScript      7

Web Scripting Fundamentals      7

Server- Versus Client-Side Programming      8

JavaScript in a Nutshell      8

Where JavaScript Came From      9

The <script> Tag      10

Introducing the DOM      11

Talking to the User      13

Summary      17

Q&A       18

Workshop      18

Exercises      19

HOUR 2: Writing Simple Scripts      21

Including JavaScript in Your Web Page      21

JavaScript Statements      23

Variables      24

Operators      26

Capturing Mouse Events      30

Summary      33

Q&A      34

Workshop      34

Exercises      35

HOUR 3: Using Functions      37

General Syntax      37

Calling Functions      38

Arguments      40

Returning Values from Functions      43

Scope of Variables      44

Summary      46

Q&A      47

Workshop      47

Exercises      48

HOUR 4: DOM Objects and Built-In Objects      49

Interacting with the User      49

Selecting Elements by Their id     51

Accessing Browser History      52

Using the location Object      53

Browser Information—The navigator Object      54

Dates and Times      57

Simplifying Calculation with the Math Object      59

Summary      64

Q&A      65

Workshop      65

Exercises      66

HOUR 5: Different Types of Data      67

Numbers      67

Strings      70

Boolean Values      73

Arrays      74

Summary      79

Q&A     80

Workshop      80

Exercises      81

PART II: More Advanced JavaScript      83

HOUR 6: Scripts That Do More      85

Conditional Statements      85

Loops and Control Structures      90

Debugging Your Scripts      94

Summary      100

Q&A      101

Workshop      101

Exercises      102

HOUR 7: Object Oriented Programming     103

What Is Object Oriented Programming (OOP)?      103

Object Creation      104

Extending and Inheriting Objects Using prototype      111

Encapsulation      115

Using Feature Detection      116

Summary      118

Q&A      119

Workshop      119

Exercises      120

HOUR 8: Meet JSON      121

What Is JSON?      121

Accessing JSON Data      123

Data Serialization with JSON      124

JSON Data Types      126

Simulating Associative Arrays      127

Creating Objects with JSON      127

JSON Security      131

Summary      132

Q&A     133

Workshop      133

Exercises      134

HOUR 9: Responding to Events      135

Understanding Event Handlers      135

Default Actions      138

The event Object      141

Cross-Browser Event Handlers      142

Advanced Event Handler Registration      146

Summary      151

Q&A      152

Workshop      152

Exercises      153

HOUR 10: JavaScript and Cookies      155

What Are Cookies?      155

The document.cookie Property      156

Cookie Ingredients      157

Writing a Cookie      158

A Function to Write a Cookie      159

Reading a Cookie      161

Deleting Cookies      162

Setting Multiple Values in a Single Cookie      165

Summary      166

Q&A       166

Workshop      

Exercises      168

PART III: Working with the Document Object Model (DOM)      169

HOUR 11: Navigating the DOM     171

DOM Nodes     171

Selecting Elements with getElementsByTagName()      177

Reading an Element’s Attributes      179

Mozilla’s DOM Inspector      180

Summary      181

Q&A     182

Workshop      182

Exercises      183

HOUR 12: Scripting the DOM      185

Creating New Nodes     185

Manipulating Child Nodes      187

Editing Element Attributes      191

Dynamically Loading JavaScript Files      192

Summary      198

Q&A      199

Workshop      199

Exercises      200

HOUR 13: JavaScript and CSS      201

A Ten Minute CSS Primer      201

The DOM style Property      204

Accessing Classes Using className      207

The DOM styleSheets Object      209

Summary      214

Q&A      215

Workshop      215

Exercises      216

HOUR 14: Good Coding Practice      217

Don’t Overuse JavaScript      217

Writing Readable and Maintainable Code      218

Graceful Degradation      221

Progressive Enhancement      222

Unobtrusive JavaScript      223

Feature Detection      226

Handling Errors Well      227

Summary      231

Q&A      232

Workshop      232

Exercises      233

HOUR 15: Graphics and Animation      235

Preloading Images      235

Animating Page Elements      236

Animating Transparency      238

CSS3 Transitions, Transformations, and Animations      239

Scripting DOM Positioning      240

Optimizing Performance      242

Summary      245

Q&A      246

Workshop      246

Exercises      247

PART IV: Ajax     249

HOUR 16: Introducing Ajax      251

The Anatomy of Ajax      251

The XMLHttpRequest Object      256

Creating Instances of XMLHttpRequest      256

Sending the Server Request      260

Monitoring Server Status      263

Callback Functions      264

responseText and responseXML Properties     265

Summary      269

Q&A      270

Workshop      270

Exercises      271

HOUR 17: Creating a Simple Ajax Library      273

An Ajax Library      273

Implementing the Library      274

Using the Library      278

Summary      284

Q&A      285

Workshop      285

Exercises      286

HOUR 18: Solving Ajax Problems      287

Debugging Ajax Applications      287

Common Ajax Errors     292

Some Programming Gotchas      297

Summary      298

Q&A      299

Workshop      299

Exercises      300

PART V: Using JavaScript Libraries      301

HOUR 19: Making Life Easier with Libraries      303

Why Use a Library?      303

What Sorts of Things Can Libraries Do?      304

Some Popular Libraries      305

Introducing prototype.js      306

Summary      313

Q&A     314

Workshop      314

Exercises      315

HOUR 20: A Closer Look at jQuery      317

Including jQuery in Your Pages      317

jQuery’s $(document).ready Handler      318

Selecting Page Elements      319

Working with HTML Content      320

Showing and Hiding Elements      321

Animating Elements      322

Command Chaining      324

Handling Events      328

Using jQuery to Implement Ajax      328

Summary      332

Q&A      333

Workshop      333

Exercises      334

HOUR 21: The jQuery UI User Interface Library      335

What jQuery UI Is All About      335

How to Include jQuery UI in Your Pages     336

Interactions      337

Using Widgets      343

Summary      348

Q&A      349

Workshop      349

Exercises      350

PART VI: Using JavaScript with Other Web Technologies      351

HOUR 22: JavaScript and Multimedia      353

Multimedia Formats      353

Browser Plug-Ins      355

Using an Anchor Tag      356

Using <embed> and <object>      356

Flash      358

Summary      362

Q&A      363

Workshop      363

Exercises      364

HOUR 23: HTML5 and JavaScript      365

New Markup for HTML5      365

Some Important New Elements      366

Drag and Drop      373

Local Storage      376

Working with Local Files      377

Summary      379

Q&A     380

Workshop      380

Exercises      381

HOUR 24: JavaScript Beyond the Web Page      383

JavaScript Outside the Browser      383

Writing Google Chrome Extensions      384

Summary      394

Q&A      395

Workshop      395

Exercises      396

PART VII: Appendices      397

APPENDIX A: Tools for JavaScript Development      399

Editors      399

Validators      400

Debugging and Verifying Tools      401

APPENDIX B: JavaScript Quick Reference      403

Index      411

Sample Pages

Download the sample pages (includes Chapter 3 and Index)

 
Best Value

Book + eBook Bundle  $62.98  $32.99

Book Price $27.99
eBook Price $5.00
eBook formats included

Buy

This book includes free shipping!

Buy

Book  $34.99  $27.99

Usually ships in 24 hours.

This book includes free shipping!

Buy

eBook (Watermarked)  $27.99  $22.39

Includes EPUB, MOBI, and PDF
About eBook Formats

This eBook includes the following formats, accessible from your Account page after purchase:

ePubEPUBThe open industry format known for its reflowable content and usability on supported mobile devices.

MOBIMOBIThe eBook format compatible with the Amazon Kindle and Amazon Kindle applications.

Adobe ReaderPDFThe popular standard, used most often with the free Adobe® Reader® software.

This eBook requires no passwords or activation to read. We customize your eBook by discretely watermarking it with your name, making it uniquely yours.

Purchase Reward: One Month Free Subscription
By completing any purchase on InformIT, you become eligible for an unlimited access one-month subscription to Safari Books Online.

Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.