Slashdot Mirror


JavaScript and DHTML Cookbook

Adios077 (Ada Shimar) writes "Ok, so I was reluctant when I first picked up and started reading O'Reilly's JavaScript & DHTML Cookbook. After all, I'm fairly proficient in JavaScript already (yes, get in line to hire me!), and if I needed some cool DHTML scripts, I could just visit a good site like Dynamic Drive. However, the book managed to both surprise and impress me, a great combination to have in a book." Find out why by reading the rest of Shimar's review, below. JavaScript and DHTML Cookbook author Danny Goodman pages 576 publisher O'Reilly & Associates rating 8.5 reviewer Ada Shimar ISBN 0596004672 summary A surprisingly useful JavaScript book, even for people skilled with the language already.

I'll begin my review by making a bold statement -- if you've read and like O'Reilly's Definitive Guides on JavaScript and DHTML, you'll adore this book. I use the word adore very deliberately here, because in my opinion JavaScript & DHTML Cookbook is much easier to love than the gigantic and sometimes monotonous Definitive Guide series. Why, you ask? Let's see -- the book is compact (some 500 pages), concise, and filled with the essence of JavaScript and DHTML as far as what you can create using the language/ technology.

JavaScript & DHTML Cookbook is broken up into 15 chapters, each containing a series of recipes. The chapters are:

  1. Strings
  2. Numbers and Dates
  3. Arrays and Objects
  4. Variables, Functions, and Flow Control
  5. Browser Feature Detection
  6. Managing Browser Windows
  7. Managing Multiple Frames
  8. Dynamic Forms
  9. Managing Events
  10. Page Navigation Techniques
  11. Managing Style Sheets
  12. Visual Effects for Stationary Content
  13. Positioning HTML Elements
  14. Creating Dynamic Content
  15. Dynamic Content Applications

These chapters are used mainly to facilitate the look up of a particular recipe, as each recipe exists and is explained independent of one another. This is consistent with the style of most Cookbooks, and it seems to work well here as well.

If you're a complete novice, you may be wondering at this point the distinction between JavaScript and DHTML. The book doesn't make a conscious effort to differentiate between the two when discussing recipes, and for a good reason. DHTML is basically JavaScript, though the latter draws in your page's HTML and often CSS as well to create something more encompassing.

Ok, on to what's important now -- the recipes themselves. I was expecting a series of flashy, long and tacky JavaScripts you can find in the source of every other site on the web these days, padded with some nonsense accolade like "the web cannot survive without them." Such scripts are mostly counterproductive, and do little to educate a JavaScript learner, let alone a master like myself (hur hur). To my delight, things were the complete opposite. The recipes in JavaScript & DHTML Cookbook are extremely practical, well thought out, and even educational. Discussions like Calculating the Number of Days Between Two Dates, Simulating a Hash Table for Fast Array Lookup, and Transforming XML Data into HTML Tables not only are very useful to the cut-and-paster, they teach even seasoned JavaScripters a thing or two about the language.

The only minor compliant I have with this book is the length of some of the script examples -- they span a little too long to follow effortlessly. The longest script I can recall in the book runs about 5 pages in length. Fortunately, such recipes are few and far in between, and 95 percent of the recipes are extremely short in length and packed with useful information and techniques. For the long scripts, it's easy to see that they exist out of necessity to create and show a fully functional script rather than just to pad pages.

In summary, I walk away from reading JavaScript & DHTML Cookbook with many new tricks up my sleeve, something I had not expected at all. Some good resources online that compliment the reading would be DevEdge's JavaScript Reference and JavaScriptKit's JavaScript tutorials."

You can purchase JavaScript and DHTML Cookbook from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

21 of 153 comments (clear)

  1. You know the world has changed... by daves · · Score: 4, Funny

    ... when a 500 page book is described as "compact".

    --
    People who disagree with you are not automatically evil, greedy, or stupid.
    1. Re:You know the world has changed... by jpkunst · · Score: 3, Insightful

      Most O'Reilly books are actually less voluminous than comparable computer books from other publishers.

      JP

  2. for those too cheap to buy a book by IFF123 · · Score: 5, Informative

    try this site instead:
    http://www.irt.org/index.htm
    if you need more help, you should try marketing instead.

    --
    Who took my tinfoil hat?
    1. Re:for those too cheap to buy a book by Anonymous Coward · · Score: 5, Funny

      Why should I listen to you? You haven't even mastered hyperlinking yet.

    2. Re:for those too cheap to buy a book by staypuft · · Score: 4, Insightful

      LOL - Where are the moderation points when you need them!

      And it is my site too!

      --
      Internet Related Technologies - http://www.irt.org
    3. Re:for those too cheap to buy a book by staypuft · · Score: 5, Informative

      You are all welcome! Just don't /. it! Bandwidth does not come cheap!

      --
      Internet Related Technologies - http://www.irt.org
  3. DHTML and javascript by ximor_iksivich · · Score: 5, Insightful

    DHTML and javascript make an excellent combination for displaying animated content.. but the question of browser incompatibilty still remains... What we need is a book for making browsers compatible first then have lots of books on the ways to use them... seems logical to me anyway :-)

    1. Re:DHTML and javascript by CowBovNeal · · Score: 3, Interesting

      You're right on that front. Quite a few people use Microsoft FrontPage for building their webpages.
      DHTML support is not that great and even then its a bit cumbersome to use than say Dreamweaver.

      Frontpage is good for those building simple websites without much user configuration. DHTML usually does not figure in it.

      --
      Bush is on fire and its not good for my lungs.
    2. Re:DHTML and javascript by pjotrb123 · · Score: 5, Informative

      Try cross-browser.com for two cross-browser DHTML Javascript libraries.
      One is complete and big, the other is more of a featherweight and a bit less powerful of course.

      --
      I liked my next sig a lot better
    3. Re:DHTML and javascript by DrSkwid · · Score: 4, Interesting

      javascript is polymorphic

      you can code round different browsers by implementing a common API for your applications and let your library do the platform specific work

      I've done plenty of intranet javascipt applications, one of which is an HTML email composer.
      It uses DHTML to drag and resize the html elements around. It works like Quark, you draw a square and type in the text.

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    4. Re:DHTML and javascript by los+furtive · · Score: 4, Informative

      May I also recommend DOM API. They are even making an effort to make sure Safari is supported (once Apple sticks in a bloody debugger).

      --

      I'm a writer, a poet, a genius, I know it. I don't buy software, I grow it.

  4. Who needs a book? by calebtucker · · Score: 5, Interesting

    Seriously, who needs a javascript and dhtml book with all of the references on the net? Just give me a nice object reference for DHTML (*cough*, MSDN isn't bad.. i hate to admit it) and DevGuru's JavaScript reference.

    --
    My sig can beat up your sig.
  5. Comment removed by account_deleted · · Score: 4, Funny

    Comment removed based on user account deletion

  6. In the future everyone will have the INTERNET by nfotxn · · Score: 3, Funny

    DHTML? I'm having flashbacks to 1996.

    --

    _nfotxn

  7. "Often with CSS"? by SvendTofte · · Score: 4, Interesting

    "often with CSS"? That doesn't even make sense.

    DHTML was coined, as the combination of HTML providing structure, CSS providing presentation, and JavaScript providing logic.

    If you just use HTML and JavaScript, you're just doing a plain HTML page with logic (like form checkers).

    I would also note, that JavaScript object are already hash tables, so "simulating hash arrays" isn't really needed (or I fail to see where it becomes relevant?)

    object["myprop"] == object.myprop

    There's only one book JavaScript programmers need, the rhino book. It's all in that. Everything else is just experience, and cannot be conveyed by a bunch of scripts. Or if it can convey something, it's most likely because said reader didn't catch it in the Rhino book ;)

  8. A Fan of Goodman's Books by borkus · · Score: 4, Informative

    I got the first Dynamic HTML when it came out then bought the second edition and the JS/DHTML cookbook.

    The cookbook is great for newcomers to web development. It is based on common tasks, i.e. "Allowing Only Numbers (or Letters) in a Text Box". It then shows how to combine the HTML, CSS and Javascript to get carry out that task. I can't count how many times that a co-worker has asked me a Javascript question and I've shown them the answer straight out of that book. For programmers new to web development, the largest obstacle isn't HTML or Javascript syntax; it's how to put together those elements. I have yet to see a book that does it as clearly as the the JS and DHTML Cookbook. For someone starting out on their first web based projects, I'd strongly recommend DHTML - the Definitive Guide and the JS/DHTML cookbook as the best references for getting started.

  9. Re:DHTML and javascript compatibility by borkus · · Score: 3, Informative

    The book has a compatibility legend for each recipe; most of the recipes work with IE 4 and NN 4.

    DOM support has become widespread enough that you can easily create DHTML features on a page that will work for over 99% of your visitors. The worst thing so far has been some of the positioning properties; however, some of that is due to the surfeit of properties used by IE.

  10. Example code, for free by Anonymous Coward · · Score: 4, Informative

    BTW, you can download example code for this book from here.

  11. What IS DHTML anyway? by aflat362 · · Score: 3, Informative

    I was under the impression that DHTML was just a buzzword. And that when anyone was talking about DHTML what they really meant was HTML pages with JavaScript or VBScript in them to make them do more than static HTML. Am I correct? If I'm wrong - than what the hell is DHTML?

    --

    Conserve Oil, Recycle, Boycott Walmart

  12. Is there work for a pure DHTML programmer? by John+Seminal · · Score: 3, Interesting

    I do not think there is work for someone to do DHTML programming. Everything I have seen is going to servlets. Nobody is putting up static pages (No matter what anyone says, JavaScript does not make a page dynamic). Why pay someone 20 dollars an hour in today's market when there are hardcore programmers unemployed, who can write Java servlets and JSP?

    --

    Rosco: "If brains were gunpowder, Enos couldn't blow his nose."

  13. Re:Not JavaScript!!! by SCHecklerX · · Score: 3, Insightful
    My favorite javascriptism is using + as both a numerical addition and a string concatenator, which, of course, is all kinds of fun in a language where you don't type your variables:

    a = 1 + 4 would yield a = '14'. Irritating.