JavaScript Cookbook
Programming the Web
Publisher: O'Reilly Media
Final Release Date: July 2010
Pages: 554

Why reinvent the wheel every time you run into a problem with JavaScript? This cookbook is chock-full of code recipes that address common programming tasks, as well as techniques for building web apps that work in any browser. Just copy and paste the code samples into your project—you’ll get the job done faster and learn more about JavaScript in the process.

You'll also learn how to take advantage of the latest features in ECMAScript 5 and HTML5, including the new cross-domain widget communication technique, HTML5's video and audio elements, and the drawing canvas. You'll find recipes for using these features with JavaScript to build high-quality application interfaces.

  • Create interactive web and desktop applications
  • Work with JavaScript objects, such as String, Array, Number, and Math
  • Use JavaScript with Scalable Vector Graphics (SVG) and the canvas element
  • Store data in various ways, from the simple to the complex
  • Program the new HTML5 audio and video elements
  • Implement concurrent programming with Web Workers
  • Use and create jQuery plug-ins
  • Use ARIA and JavaScript to create fully accessible rich internet applications
Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
O'Reilly MediaJavaScript Cookbook
 
4.0

(based on 5 reviews)

Ratings Distribution

  • 5 Stars

     

    (1)

  • 4 Stars

     

    (3)

  • 3 Stars

     

    (1)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (0)

100%

of respondents would recommend this to a friend.

Pros

  • Easy to understand (4)
  • Helpful examples (4)
  • Well-written (4)

Cons

    Best Uses

    • Intermediate (5)
    • Expert (3)
      • Reviewer Profile:
      • Developer (4)

    Reviewed by 5 customers

    Sort by

    Displaying reviews 1-5

    Back to top

    (1 of 1 customers found this review helpful)

     
    4.0

    Good book to have handy

    By Larry

    from Somerville, MA

    About Me Developer

    Pros

    • Concise
    • Easy to understand
    • Helpful examples
    • Well-written

    Cons

      Best Uses

      • Expert
      • Intermediate
      • Novice

      Comments about O'Reilly Media JavaScript Cookbook:

      Of course, the same can be said for just about all of the hi-tech cookbooks. Sure there's Google, but this (and most other cookbooks) usually go into more detail about why the solutions work, in addition to providing other alternatives and describing similarly-flavored problems. This book covers a wide swath of topics, e.g. the usual objects, events, forms, etc., in addition to sections on debugging, SVG, HTML and CSS. It also does a good job of providing browser-specific information, long the bane of client-side programming.

      (4 of 4 customers found this review helpful)

       
      3.0

      Good set of JavaScript recipes w/HTML5

      By greygeek

      from Boston, MA

      About Me Sys Admin

      Verified Reviewer

      Pros

      • Accurate
      • Well-written

      Cons

      • Not widely applicable

      Best Uses

      • Expert
      • Intermediate

      Comments about O'Reilly Media JavaScript Cookbook:

      I have enjoyed other cookbooks in the O'Reilly library of computer texts, so when I saw JavaScript Cookbook by Shelley Powers in the catalog, I jumped at it. The description mentioned that the book would cover HTML5 and ECMAScript 5, so I really wanted to learn the new capabilities of both. I did get to learn a lot, but I wonder if these new features are too new.

      Like other cookbooks in the O'Reilly library, this one is organized as a series of specific problems, with their solutions neatly presented and grouped into the major chapters. Each solution has a discussion to flesh out the details. The website has downloadable copies of the examples in the book, which I used to test out the various recipes. ECMAScript 5 is fairly new, and HTML5 is still under development, so I made sure I had the latest stable versions of the major browsers (Firefox, Google Chrome, Internet Explorer, Opera, and Safari) to see how they would cope. The HTML5 features are very sparsely supported as of yet, so those portions of the book should be considered more of a sampling of things to come rather than a definitive set of solutions.

      They start out easily enough with recipes for handling JavaScript strings. However, the discussion of String objects and literals obviously implies that the reader is already somewhat familiar with Object terminology and functionality. That makes this book unsuitable for beginners.

      While much of the book is applicable to today's browsers, there is a lot of coverage of the new capabilities made available in the new HTML5 specifications. Unfortunately, most browsers either do not support, or only partially support these features, so the information is only useful as a "taste of things to come".

      As I step back and reflect on this book, I think that many topics are solutions that cannot be implemented because the typically available browsers don't support the new features yet. If a web page designer wants their site to be available to users now, they need to focus on the features that are well entrenched across the internet. Having so many solutions based on features and capabilities that are still being defined is only useful as academic exercises. I would have preferred that the JavaScript Cookbook be more useful for the state of the web right now. That is why I'm rating it only 3 out of 5.

      (2 of 2 customers found this review helpful)

       
      4.0

      Fountain of Scripting Knowledge

      By Lee S

      from Sydney, AU

      About Me Designer, Developer

      Verified Reviewer

      Pros

      • Easy to understand
      • Helpful examples

      Cons

        Best Uses

        • Expert
        • Intermediate
        • Student

        Comments about O'Reilly Media JavaScript Cookbook:

        Read the preface, these examples are for modern up to date browsers not relics like IE6. There are some suggestions made for IE7 though.

        As far as the Cookbook series goes, it follows the path of presenting a Problem, Solution and some Discussion. This is a great and fast way to learn a language as well as gain a solution even faster. If you haven't learnt Javascript before, then this book will give you a hint as to how this particular language handles solutions to common web applications.

        These Problems and Solutions are not a complete collection, but represent a very large number of common issues people will face with interaction on the web.

        The download for the code from the book seems to be quite large at 62MB compressed, which is probably quite impressive in showing how much detail and example is being given in this edition. A great bundle of resources I'm still going through.

        I'm not fluent in Javascript and this book has shed some light on some areas that I wasn't confident in or didn't quite understand.

        Would highly recommend this to freelance designers especially.

        (2 of 2 customers found this review helpful)

         
        5.0

        A lot of javascript solutions

        By Mark

        from Sacramento, CA

        About Me Designer, Developer

        Pros

        • Easy to understand
        • Helpful examples
        • Well-written

        Cons

          Best Uses

          • Intermediate
          • Novice

          Comments about O'Reilly Media JavaScript Cookbook:

          Javascript is similar enough to languages I know that I've just picked up enough of it along the way to get done whatever I needed to. I read this book in hope of getting solutions I could adapt for some of my web programming needs while learning more about what javascript could do now and in HTML5. I was not disappointed as the book met those expectations and then some.

          As a cookbook, the book follows a Problem, Solution, Discussion format. The problems addressed are grounded in the real world and the solutions vary from very simple to rather complex. The discussion provides in depth information about the solution and sometimes includes alternatives. Of particular interest to me on the first reading were the chapters on event handling, form elements, and persistence. I was also pleased that the solutions addressed handling the current versions of the four major browsers.

          Bottom line: After reading this book I have a better understanding of javascript and what I can do with it. I will be keeping it handy as a source for code snippets as well as a reference for future javascript coding.

          (3 of 3 customers found this review helpful)

           
          4.0

          Helps you truly understand Javascript

          By svendecabooter

          from Ghent, Belgium

          About Me Developer

          Verified Reviewer

          Pros

          • Easy to understand
          • Helpful examples
          • Well-written

          Cons

            Best Uses

            • Intermediate
            • Student

            Comments about O'Reilly Media JavaScript Cookbook:

            This book on Javascript follows the O'Reilly Cookbook series 'recipe' format, laying out a whole list of practical problems and tasks that (aspiring) Javascript developers are faced with, and provides the solution and background discussion needed to truly get the task done, and understand the reasoning behind it.

            The first few chapters of the book start of by explaining the basics of the Javascript language, providing insights and tips around working with strings, numbers, arrays, loops, functions, events etc... A seasoned Javascript programmer will probably already be familiar with most of this functionality, but I found it interesting enough to keep on reading these 'basic' chapters, because the author gives a good background explanation and points to more obscure or browser-specific problems that arise when using these concepts.

            The next few chapters go a little deeper into error handling, debugging, the different methods to accessing DOM elements, and adding interactive functionality to your webpages. The author took a very interesting approach with the chapter on interactive elements, by focusing highly on having the ARIA (Accessible Rich Internet Applications) attribute set baked in into the examples. I hadn't used this myself before, and found it truly fascinating to read how to make rich Javascript interactions accessible to all users, with only a few lines of added code in most cases.

            The more advanced chapters in the book explain in great detail the newer cutting edge functionalities that are starting to be implemented by most browsers, including working with HTML5 audio & video elements and persistent data storage, SVG graphics, canvas elements, etc ... The book even covers topics that are just recently included (or even not included yet) in modern browsers, giving the reader an idea of what the exiting new functionalities are about, and how to leverage them. In the last chapter we leave the browser and explore Javascript in other environments, such as browser extensions, mobile widgets, etc..

            One downside of the book is that it doesn't take IE6 into consideration anymore, which is unfortunately not the case in real life situations. Perhaps some more information on how to provide graceful degradation for IE6 would have been helpful.

            Overall this book provides a lot of great insights and best practices regarding a wide range of topics, aimed at Javascript developers with various skill sets, and is very thorough and detailed in its explanations.

            Displaying reviews 1-5

            Back to top

             
            Buy 2 Get 1 Free Free Shipping Guarantee
            Buying Options
            Immediate Access - Go Digital what's this?
            Ebook: $39.99
            Formats:  APK, DAISY, ePub, Mobi, PDF
            Print & Ebook: $54.99
            Print: $49.99