JavaScript Cookbook

Author: Shelley Powers
Publisher: O'Reilly, 2010
Pages: 560
ISBN: 978-0596806132
Aimed at: Javascript programmers
Rating: 4
Pros: Wide selection of recipes
Cons: Poor explanations of object-oriented topics
Reviewed by: Ian Elliot

 

 

A cookbook is always going to be a mixed bag - but does this one have something for everybody?

 

Author: Shelley Powers
Publisher: O'Reilly, 2010
Pages: 560
ISBN: 978-0596806132
Aimed at: Javascript programmers
Rating: 4
Pros: Wide selection of recipes
Cons: Poor explanations of object-oriented topics
Reviewed by: Ian Elliot

Cookbooks are always difficult to review because how you react to them depends on whether the topics you are interested in overlap with the recipes presented. In this case there has to be something that you find useful as there is such a wide coverage. Some of the recipes are at the level of the obvious - for example Trimming Whitespace from the Ends of a String, which basically comes down to "use trim", but even here there is some extra help just in case the version of Javascript you are using doesn't support trim. The book also doesn't cover IE 6 and often has IE7 workarounds in the recipes.

 

Banner

 

The explanations of how the recipes work is good when what is going on is basically simple but in some of the more advanced recipes - especially anything object-oriented - the explanation were insufficient. Some subtle topics are well explained however like the reason why you shouldn't use an Array object as an associative array.

The book starts off with pure Javascript recipies: strings, regular expressions, dates and time, maths,arrays and functions. Slowly but surely the book heads off into Javascript/browser interaction. Chapter 7 deals with handling events, 8 general browser interaction, 9 forms, 10 debugging and so on. Chapter 11 to 14 deal with the detailed business of interacting with the DOM and using it to control the page - accessing page elements, creating and modifying page elements. Chapter 15 deals with rich media and interactive applications including SVG, Canvas and audio/video.

Chapter 16 is a potted look at object-oriented aspects of Javascript but to be honest you would be better off reading another book on the subject if this is what you are interested in. The final chapters deal with an irregular collection of topics. Chapter 17 is about Javascript libraries - JsUnit and JQuery in particular. Chapter 18 is where Ajax is covered under the title of Communications. Chapter 19 deals with structured data - aka JSON. Chapter 20 is about persistence and mostly deals with cookies, and other methods of saving state. The final chapter deals with other uses including writing browser add-ons, desktop and mobile widgets and the worker API.

One of the problem is working out which of the recipes will work in the environment you are targeting, there are a quite a few uses of HTML5 for example - a problem made worse if you are targeting multiple environments.

Overall this is a useful book and you should be able to find something in it that repays its price.


Banner


Python All-in-One, 2nd Ed (For Dummies)

Authors: John Shovic and Alan Simpson
Publisher: For Dummies
Date: April 2021
Pages: 720
ISBN: 978-1119787600
Print: 1119787602
Kindle: B091DGDLK8
Audience: People wanting to learn Python
Rating: 2
Reviewer: Mike James
All-in-one refers to the fact that this is seven books put together - why?



Killer ChatGPT Prompts (Wiley)

Author: Guy Hart-Davis
Publisher: Wiley
Pages: 240
ISBN: 978-1394225255
Print: 1394225253
ASIN: B0CF3WFTWM
Audience: Everyone
Rating: 5
Reviewer: Ian Stirk

This book aims to get optimal answers to your questions from ChatGPT, how does it fare? 


More Reviews

Last Updated ( Friday, 15 October 2010 )