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.

153 comments

  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 el-spectre · · Score: 1

      For an O'Reilly book, that IS compact...

      --
      "Faith: Belief without evidence in what is told by one who speaks without knowledge, of things without parallel." - A.B.
    2. 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 DrSkwid · · Score: 0, Troll

      hyperlinks are for lusers

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    3. 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
    4. Re:for those too cheap to buy a book by Bluetrust25 · · Score: 2, Informative

      > And [www.irt.org] is my site too!

      irt.org is a very nice site. Your javascript FAQ has saved my ass more times than I can count. It's certainly the first place I go when I have a javascript problem or just need a quick solution. Mega-kudos to you my friend.

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

      Ditto on the kudos. I've taught several JavaScript classes for a consulting company and I *always* make sure the students get told about that site.

      irt.org is pretty much my *only* reference for javascript stuff other than my JavaScript Bible...

      Thanks again.

      --
      In the Portland, Ore area and like card games? Check out: http://groups.yahoo.com/group/portlandgames/
    6. 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
    7. Re:for those too cheap to buy a book by killthiskid · · Score: 1

      Uh oh... considering the response of your site at this point, it looks as though your anti-/. request was in vain...

    8. Re:for those too cheap to buy a book by Tony-A · · Score: 1

      Or.
      He has mastered hyperlinking.

      As much lookee lookee clikee clikee as has been going on, ...
      Anybody interested can surely copy/type the link into a browser.

    9. Re:for those too cheap to buy a book by Anonymous Coward · · Score: 0

      Bandwidth does not come cheap!

      Then don't waste it. For example, www.example.com/index.html is a different resource to www.example.com - so by linking (or rather, providing the address) to the index.html version, you've reduced caching by a great deal compared with if you supplied the right address.

      On the other hand, judging by the headers sent out by the homepage, it seems you haven't paid any attention whatsoever to caching, in which case, this is the least of your worries.

    10. Re:for those too cheap to buy a book by Isofarro · · Score: 1

      Hmmm.. I've always preferred javascript faqts, run by Martin Honnen. It is a little difficult to search, a bit unintuitive, but there's stacks of excellent and up-to-date scripting info there.

  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.

    5. Re:DHTML and javascript by On+Lawn · · Score: 2, Insightful

      I don't think "can" has been the question as much as its so plain annoying. I'm sure plenty of people could provide commentary on the issues of portability of code in browsers vs OS's and computers.

      Language portability happens in C all the time, and is managed through a number of very difficult tools. In Javascript, it does it in runtime, figuring out its environment and adjusting which routines will run dynamically. In Java the environment provides the portability.

      Portability is a worth-while goal in that it provides freedom. But is it too much to ask for a Javascript's portability to be pushed from run-time to handled by the environment? It shouldn't be a question of diversity of environments and a willingness to stop trying to screw each other over. Thats all.

      Not to rant on your comment, you just brought up a pet peeve of mine.

    6. Re:DHTML and javascript by hey · · Score: 1

      Hey that site didn't render correctly in Mozilla!!!
      It appeared nearly all black. It worked in Internet Explorer. Do I have to say this is the most ironic thing on the Internet!!!

    7. Re:DHTML and javascript by ryan76 · · Score: 1

      Do you have an example of how you implement the polymorpism? Do you have anything cleaner than if (Internet Explorer)... if (Netscape)... etc?

      --
      http://threetechguys.info Come, discuss Technology. Got a technology question? Come ask!
    8. Re:DHTML and javascript by Anonymous Coward · · Score: 0

      Jesus. There is no way on earth I am going to use code from people who don't even understand why 1mm high text on a website is a bad idea.

    9. Re:DHTML and javascript by DrWhizBang · · Score: 1

      i just tried this site with safari - not good.

      --
      Schrodinger's cat is either dead or really pissed off...
    10. Re:DHTML and javascript by Evil+Grinn · · Score: 1

      DHTML and javascript make an excellent combination for displaying animated content.. but the question of browser incompatibilty still remains...

      If you can deprecate Netscape 4 and below and IE 5.0 and below (5.5 is generally OK), the incompatibilities really aren't all that bad. Newer versions of the "big two" are mostly standard-compliant, or at least compatible with each other.

      There are a few annoyances such as different levels of support for CSS, but these are nothing compared to the nightmare that was cross-browser DHTML just a couple of years ago.

    11. Re:DHTML and javascript by DrSkwid · · Score: 1

      This isn't quite a demonstration of polymorphism at work but it does show one approach to cross platform design

      <div style="width:500px; background:red;" id="red">Red</div>

      <div style="width:500px; background:green;" id="green">Green</div>

      <script language="javascript">
      // this will hold a function
      var mousehandling;

      // my class
      function Point(x, y) {
      this.x = x
      this.y = y
      }

      switch(navigator.appName) {
      // lame browser detection
      case "Microsoft Internet Explorer" :
      mousehandling = IE;
      break;
      case "Netscape" :
      mousehandling = NS6MOZ;
      break;

      }

      function MouseDown(pt, id) {
      what to do when a mouse button is pressed
      alert("x:" + pt.x + " y:" + pt.y + " id:" + id);

      }

      function NS6MOZ () {
      // netscape mozilla's way of handling mouse events
      window.captureEvents( Event.MOUSEDOWN );

      // onmousedown is a built in function of Window, but let's redefine it
      window.onmousedown = function (ev) {
      var id = "";
      if (ev.target.nodeName=="#text")
      id = ev.target.parentNode.id
      else
      id = ev.target.id

      MouseDown(new Point(ev.pageX, ev.pageY), id);
      }
      }

      function IE() {
      // I.E's way
      // onmousedown is a built in function of Document, but let's redefine it
      document.onmousedown = function () {
      var we = window.event;
      MouseDown(new Point(we.x, we.y), we.srcElement.id);
      }

      }

      //okay lets set up our mouse handling
      mousehandling()

      // In my application I was setting the mouse handling across frames
      // so I was using parent.frames.main.document & parent.frames.main.window

      </script>

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    12. Re:DHTML and javascript by Anonymous Coward · · Score: 0

      Excellent reasoning, dripping in logic.
      Good luck with that.

    13. Re:DHTML and javascript by allcrispy · · Score: 1

      Allow me to rewrite this for modern browsers:

      <div style=width:500px; background:red; id=red>Red</div>
      <div style=width:500px; background:green; id=green>Green</div>

      <script type=text/javascript>

      // my class
      function Point(x, y) {
      this.x = x;
      this.y = y;
      }

      function MouseDown(pt, id) {
      // what to do when a mouse button is pressed
      alert('x:' + pt.x + ' y:' + pt.y + ' id:' + id);
      }

      if (typeof document.addEventListener != 'undefined') {
      // DOM 2 event handling
      document.addEventListener('mousedown', mouseDownHandler, false);
      } else if (typeof document.attachEvent != 'undefined') {
      // IE5+ event handling
      document.attachEvent('onmousedown', mouseDownHandler);
      } else {
      // IE4 event handling
      document.onmousedown = mouseDownHandler;
      }

      function mouseDownHandler(e) {
      if (typeof e == 'undefined') e = window.event;
      var id;
      if (typeof e.target != 'undefined') {
      if (e.target.nodeName == '#text') {
      id = e.target.parentNode.id;
      } else {
      id = e.target.id;
      }
      } else if (typeof e.srcElement != 'undefined') {
      id = e.srcElement.id;
      }
      MouseDown(new Point(e.clientX, e.clientY), id);
      }

      </script>

  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.
    1. Re:Who needs a book? by kberg108 · · Score: 0

      you know what you're absolutely right. I have been writing javascript since it's inception and I have only found the books to be a waste of time. Between MSDN's extensive DOM reference and devedge's language reference I have never needed a book ever JS book I have aver had is complete garbage. Maybe I'll have my company pick up this book so i can write back to ./ just to bash it :)

      --
      I like things that are sweet and not things that are lame. --
    2. Re:Who needs a book? by greenhide · · Score: 2, Informative

      I've used Dynamic HTML, another O'Reilly book, for some time now.

      It's a great reference, and makes it easy to look up all of the various HTML elements, CSS styles, and JavaScript objects.

      The advantage is that it's all in one place, and I can read it while it's lying on my desk, and have a text editor window open to type in my code. It's a pain to constantly switch back and forth between two windows when you're in an intensive coding session -- well, it is for me at least.

      It's like a dictionary. You can use dictionary.com (or a variant therof), but sometimes it's just easier to have the book by your side.

      That being said, there are also some excellent online resources, and it certainly makes good sense to use those as well.

      --
      Karma: Chevy Kavalierma.
    3. Re:Who needs a book? by meknapp · · Score: 1

      From the summary:

      Ok, so I was reluctant when I first picked up and started reading ... After all, I'm fairly proficient in JavaScript already ... and if I needed some cool DHTML scripts, I could just visit a good site ... However, the book managed to both surprise and impress me, a great combination to have in a book.

      Emphasis mine.

      --
      "Any fool can criticize, condemn and complain and most fools do." -- Benjamin Franklin
  5. $4 less and free shipping! by Anonymous Coward · · Score: 1, Informative
    1. Re:$4 less and free shipping! by connsmythe96 · · Score: 0, Offtopic

      Is this becoming the latest /. karma whoring method?

      --
      if(!cool) exit(-1);
    2. Re:$4 less and free shipping! by baldass_newbie · · Score: 1, Informative

      Get it at bookpool.com for $24.50 and don't give business to the AC.

      --
      The opposite of progress is congress
    3. Re:$4 less and free shipping! by wzm · · Score: 1, Insightful

      It seems to be, usually with a follow up post that a different site has it even cheaper then Amazon. I'm curious as to how frequently the ACs involved have some sort of referal system going on, and how that effects the posts rating. Do people usually rate such comments more poorly, or does no one notice/care? If they/you do rate it lower, why? Do you rate other people lower when they are advocating something they have a financial interest in, and if so why are celebrities exempt, such as John Carmack?

    4. Re:$4 less and free shipping! by greenhide · · Score: 2, Insightful

      Ha ha...See postings above to see irony in the -1 offtopic mod. The guy who gives the amazon post is modded as informative -- gee, who woulda thunk it? "Amazon is selling an O'Reilly book", now that's informative -- and trying to make money off of it too. This last post, which offers a much better retailer (in terms of price), is modded as offtopic. My suggestion? Don't mod these kinds of comments at all. Everyone knows that you can buy books at online retailers.

      At least, don't mod them until they create the

      +1 Offered Lazy Asses Like Me the Link

      moderation.

      --
      Karma: Chevy Kavalierma.
    5. Re:$4 less and free shipping! by Mryll · · Score: 1

      Damn, beat me to that one.

  6. Only five comments... by locknloll · · Score: 1

    ...and the DynamicDrive site gets so slow you might think it's being slashdotted.
    Just wondering if you ever get any nice scripts from that site...

    --
    -- Power corrupts, but PowerPoint corrupts absolutely.
  7. Comment removed by account_deleted · · Score: 4, Funny

    Comment removed based on user account deletion

  8. Re:the steps by Anonymous Coward · · Score: 2, Funny
    1.Everyone type as root: rm -rf /
    C:\>rm -rf /
    'rm' is not recognized as an internal or external command,
    operable program or batch file.

    C:\>
    Windows is apparently not vulnerable to your 1337 social enginner hax0ring techniques.
  9. dhtml demo by CausticWindow · · Score: 1

    If you want a little demo of what you can do with dhtml, check out "Hau Strange" by the demoscene group Haujobb

    Think you need modplug to get the music.

    --
    How small a thought it takes to fill a whole life
    1. Re:dhtml demo by G-funk · · Score: 1

      Gah... I had dhtml copper bars in 1998 :)

      the wayback machine knows all of course it's ie only (hey it was 98, NS sucked balls), and the images are long dead as net-effect has been out of business for years.... but there my trumpet is blown :-)

      --
      Send lawyers, guns, and money!
    2. Re:dhtml demo by CausticWindow · · Score: 1

      Nice.. Do you happen to know where I can find more dhtml "scene" related stuff?

      I stumbled upon a nice dhtml 4 kb compo site some time ago (with everything from fractal zommers to raycasting engines), but I can't seem to find it with Google now.

      --
      How small a thought it takes to fill a whole life
    3. Re:dhtml demo by Nexzus · · Score: 1

      You might be thinking about The 5K a competition to do as much functionality as you can into 5 Kilobytes worth of HTML and Script. Some interesting, creative stuff in there, and a nice lesson in obfustication.

      Although I believe there is a "most obfusticated" C competition out there, too.

      --
      Karma: Can only be portioned out by the Cosmos.
    4. Re:dhtml demo by TheViciousOverWind · · Score: 1

      Try clicking "Texture Mapping" on this link (The other examples are nice too).

      I've got a website I wrote, some time ago, which is written 99% in JavaScript (and DOM). See it here: Urgent.

      If anyone's interested, there's the link to my JavaScript TreeView (Open Source!) in my signature, so go ahead and try it out</advertising>. ;-)

      --
      My <1000 UID is with a hot chick
  10. JavaScript in a Linux Documentation Project by Anonymous Coward · · Score: 1, Informative
    The Linux Documentation Project (TLDP) is developing a prototyping authoring tool that is using a fair bit of JavaScript. If anyone is interested in volunteering/taking over development, you could check out the The LDP HOWTO GENERATOR.

    Even just a tips or suggestion to the author would be useful; TLDP is always looking for inputs to the projects and this is a recent project.

    1. Re:JavaScript in a Linux Documentation Project by Anonymous Coward · · Score: 0
      Just to add some info to the purpose of this thing:
      TLDP publishes a lot of documentation and requires it to be made in a markup language such as SGML or XML. There is a learning curve here that, added with the tools, can put off prospective authors. The idea of the prototype tool than is to let an author concentrate on contents, not form and not even markup.

      Just fill in the form, hit the button at the end and (insert a Ta-daaah if you wish) you get the ready marked up text in the window at the end. Just copy it and paste it into an editor and continue using the pattern you already see. You can also get some more patterns from the Big HOWTO Template(SGML) (HTML).

      More authoring help is at Author Resources.

      Good to see an example of JavaScript that is not just for making flashy web pages or filling in forms to be spammed with later...

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

    DHTML? I'm having flashbacks to 1996.

    --

    _nfotxn

  12. "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 ;)

    1. Re:"Often with CSS"? by syncrus · · Score: 0

      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 simply doing a plain HTML page with logic (like form checkers).

      Nope... DHTML also happens whenever HTML is generated via JavaScript sentences, or DOM content gets changed during runtime (i.e. via JavaScript execution - ok, or any other script language), rather than just checked, as you suggest. So, DHTML should be thought as Dynamic HTML, as opposed to (static) HTML.

      CSS simplifies greatly the process of putting content on screen, and a good DHTML programmer should have a good knowledge of CSS, but you can still go the DHTML way ignoring CSS - no matter how Klingon that sounds... ;-)

      --
      To sig or not to sig.
    2. Re:"Often with CSS"? by SvendTofte · · Score: 1

      Then you get into a battle of words of the meaning "dynamic", I use the word dynamic, in the way it was introduced, with the level 4 browsers, "DHTML" capabilities. To say that Netscape 3 did "Dynamic" HTML doesn't hold up. As for DOM content changing, doesn't hold either. Changing DOM content was one of the first things Netscape allowed, mostly via forms. Is changing the value of a form element truly "Dynamic" HTML? Only in the real sense of the meaning "dynamic", and not in the way it has achieved popularity, as Dynamic HTML in level 4 browser (colourfull stuff flying around).

    3. Re:"Often with CSS"? by syncrus · · Score: 1, Informative
      Then you get into a battle of words of the meaning "dynamic", [...] As for DOM content changing, doesn't hold either. Changing DOM content was one of the first things Netscape allowed, mostly via forms. Is changing the value of a form element truly "Dynamic" HTML?
      I don't mean changin values in forms (you don't need the full power of DOM to do that), but changing anything present in a web page via the DOM model, which contains everything you can see on screen. I mean, there are wordprocessors out there programmed in JavaScript, so that content is generated dynamically. Have a look at this code:
      if (myVar == "dyn") {
      document.write('<p>Dynamic paragraph.</p>');
      }
      You can see that this <p> block may or may not appear in the webpage depending of certain condition, be it the passing of time, the content of a form, the position of the mouse... Whatever you want. That's what I mean by DOM.
      Only in the real sense of the meaning "dynamic", and not in the way it has achieved popularity, as Dynamic HTML in level 4 browser (colourfull stuff flying around).
      That would be the popular definition of dynamic content among non programmers, wouldn't it? Most people reading this are programmers/interested in programming, so we both agree that we are talking of the other dynamic meaning. Anyway... You can get flashy content via DHTML, so it could be considered a subset anyway.
      --
      To sig or not to sig.
  13. Like your sig? (-1, flamebait) by A+nonymous+Coward · · Score: 0

    Har de har har, a self fulfilling luser :-) :-)

    1. Re:Like your sig? (-1, flamebait) by DrSkwid · · Score: 1

      8) I know, I realised that when I saw submit come back

      hmm maybe if I say, "lusers drink milk so they need the link" wll that do?

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  14. 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.

  15. Save $1.18 more and free shipping by A+nonymous+Coward · · Score: 2, Informative

    I can karma whore too :-)

    Try Books-A-Million and avoid supporting Amazon patents and non-privacy.

    1. Re:Save $1.18 more and free shipping by Anonymous Coward · · Score: 0

      This isn't karma whoring....it's the more traditional kind...for $$$!

    2. Re:Save $1.18 more and free shipping by Head · · Score: 1

      Or stop being so cheap and support your local bookstore.

      Can you tell my wife works at the local bookstore? ;-)

  16. Vendor Specific by rossz · · Score: 0, Informative

    DHTML is a Microsoft creation and is not part of any recognized standard. Using it only perpetuates the ongoing attempt to control the internet through proprietary extensions.

    If you don't think this is a bad thing, then go ahead and use DHTML. While you're at it, toss in some vbs to really screw things up.

    --
    -- Will program for bandwidth
    1. Re:Vendor Specific by Anonymous Coward · · Score: 1, Informative

      Not really.

      No one has to use microsoft DOM, in fact, all vendor specific DOMS are being phased out in preference to the W3C model.

      From w3c.org:

      "Dynamic HTML" is a term used by some vendors to describe the combination of HTML, style sheets and scripts that allows documents to be animated. The W3C has received several submissions from members companies on the way in which the object model of HTML documents should be exposed to scripts. These submissions do not propose any new HTML tags or style sheet technology. The W3C DOM WG is working hard to make sure interoperable and scripting-language neutral solutions are agreed upon.

    2. Re:Vendor Specific by FyRE666 · · Score: 1

      DHTML is a Microsoft creation and is not part of any recognized standard.

      How on Earth was this modded up as informative? Sure, it informs us that rossz is totally ignorant about this subject, but DHTML is definitely NOT a "Microsoft creation". Netscape 4 had DHTML capabilities well before the first capable MS browser (IE4) appeared.

      DHTML stands for "Dynamic HTML". It's the result of manipulating the browser DOM using a scripting language (virtually always Javascript).

    3. Re:Vendor Specific by Anonymous Coward · · Score: 0

      DHTML stands for dynamic HTML. It is just HTML + CSS + a scripting language and there are standards for all three. So there is nothing about DHTML that is inherently proprietary (I write DHTML for Netscape/Mozilla all the time). Microsoft does do a poor job of implementing these standards the way they were intended, but that's a seperate issue.

    4. Re:Vendor Specific by greenhide · · Score: 1

      Hmmm...it's possible that the term DHTML was coined by Microsoft.

      Nonetheless, DHTML itself -- that is, combining JavaScript, HTML, and CSS -- isn't proprietary at all.

      And you can still follow web standards when using DHTML techniques.

      Everything I've ever done using DHTML works on Netscape Navigator 4 through the current versions of Mozilla and Safari, which as far as I know are about as standards-based as you can get.

      The point is, DHTML is useful. Without it, there are a lot of things that you simple can't do. It's pointless to worry about who might have originated the term. In practice, DHTML isn't exclusive to Microsoft, unlike vbs which I have never used.

      --
      Karma: Chevy Kavalierma.
  17. Not JavaScript!!! by AKAImBatman · · Score: 2, Interesting

    Personally, I tend to dislike JavaScript. It has its uses, but JS programs quickly turn into huge messes that Anderson himself couldn't debug. Of course, most of these problems stem from the lack of engineering that goes into most Javascript code. If you define clear APIs (like any good engineer should) Javascript ends up being not half bad.

    BTW, can anyone spot the problem with this code:

    function myfunc1()
    {
    for(i=0; i<10; i++) myfunc2(i);
    }

    function myfunc2(value)
    {
    for(i=0; i<15; i++) //do something;
    }

    Here's a hint for you. "i" in myfunc1() is not what you expect it to be.

    1. Re:Not JavaScript!!! by Anonymous Coward · · Score: 0

      I dislike it too, but mostly because Lynx doesn't support it (or for that matter any console-based www browser that I know of). And even if it did, I doubt all those crazy funky dynamic rollover menu thingys would work right anyway...

    2. Re:Not JavaScript!!! by One+Louder · · Score: 1

      Well, if you're not going to declare 'i' as a local var of each function, you're asking for trouble. You shouldn't be too surprised to find it.

    3. Re:Not JavaScript!!! by AKAImBatman · · Score: 1

      And how many "programmers" realize that problem? They don't see the need to define variables. Since Javascript simply lets them create variables willy-nilly, they spend hours banging their heads against the wall trying to figure out why code written in two minutes takes 30 hours to debug. By the time they "fix" it (i.e. randomly changing code), they probably still don't know what was broken. Thus my point of why I don't like Javascript.

    4. Re:Not JavaScript!!! by djeaux · · Score: 1

      OK. I see your point now. Just remember it when the next PHP book is reviewed! :-D

      --
      "Obviously, I'm not an IBM computer any more than I'm an ashtray" (Bob Dylan)
    5. Re:Not JavaScript!!! by FryGuy1013 · · Score: 1

      php variables are not inherited into local scopes from the global scope. You need to use $_GLOBALS["varname"] or put global $varname; .. nevermind I see your point.

      --
      bananas like monkeys.
    6. 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.

    7. Re:Not JavaScript!!! by ip_vjl · · Score: 1


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


      Where (what browser) do you see that behaviour?

      With a straight assignment:
      a = 1 + 4;
      'a' should yield 5.

      If 'a' already contains string data and you append to it:
      a = "";
      a+= 1;
      a+= 4;
      then you'll end up with "14"

      Though, if you do:
      a = "";
      a+= 1+4;
      you'll end up with "5" because the numeric operation takes precedence over the assignment.

      Not sure if all browsers will behave this way, but the Moz/Firebird js console bears this out.

    8. Re:Not JavaScript!!! by brundlefly · · Score: 1

      This entire sub-thread of I-hate's can be paraphrased as "I hate it because it's different from what I use every day."

      ...which says more about the poster than the language being discussed.

    9. Re:Not JavaScript!!! by Phrogz · · Score: 1

      a=1+4 == 5
      a=1+'4' == '14'
      a=1+'4'*1 == 5

      Just *1 your strings ... its less characters and faster execution than new Number() or parseInt(foo,10);

    10. Re:Not JavaScript!!! by AKAImBatman · · Score: 1

      Actaully, I don't hate Javascript. I dislike it. Bit of a difference there. The reason why I dislike it is because of all the pitfalls *built-in* to the language. I named one, grandparent named another. There are tons more that will snag anyone who doesn't have knowledge of what goes on under the hood. How is your junior programmer supposed to know the difference between a string and a number? He just write some HTML/ColdFusion/JSP/ASP/Whatever and the results spit out the other end. He has no clue why 1+4 suddenly equals 14 or why "i" is equal to 15 after its first iteration. And truth be told, he SHOULDN'T have to understand that. That's why strongly typed languages are A Good Thing(TM).

    11. Re:Not JavaScript!!! by Jotham · · Score: 1
      yeah, non-initiated variables get given a global scope.

      use var to give it a local scope.
      ie. for(var i=0; i10; i++) myfunc2(i);

    12. Re:Not JavaScript!!! by cloudmaster · · Score: 1

      Any boob looking at their code should see that they're never using the parameter passed into myfunc2, though. If you change "value" to "i", (function myfunc2(i))then you get a localized version of i and this code does exactly what it was "supposed" to do - run though 0-14 10 times.

      This isn't something a competent programmer should have a problem with anyway, though several of those out there using JS are far from what I'd call "competent programmers"....

    13. Re:Not JavaScript!!! by AKAImBatman · · Score: 1

      We're assuming that we do something with "value" in the area where it says "//do something". The case I've given here is actually quite common since programmers are used to using "i", "j", and "k" for loop counters. A programmer will *think* he's fine by using "i" in another function, but he's actually screwing up his program beyond beiief.

      If JavaScript actually required the programmer to define his variables, this problem would go away. The only time being able to create variables out of the blue worked, was back in the days of procedural BASIC (everything was global anyway). Even then, programmers were encouraged to define their variables so they knew what was in use.

    14. Re:Not JavaScript!!! by Anonymous Coward · · Score: 0

      I can't stand anything related to HTML because it won't work on my old sinclair spectrum.

    15. Re:Not JavaScript!!! by cloudmaster · · Score: 1

      Yeah, I guess that doing stuff to "value" inside of the loop would make this a good example...

      I dunno, I always use "var blah" anyway - so this should be a fun thing to bug my cow-orkers about.

  18. 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.

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

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

  20. 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

    1. Re:What IS DHTML anyway? by djeaux · · Score: 1
      If I'm wrong - than what the hell is DHTML?

      It's like Margaritaville. Somebody once asked Jimmy Buffett where the hell Margaritaville was & he said, "It's wherever you want it to be."

      Some folks say DHTML is JavaScript-enhanced HTML. Others like to throw in a pinch of Perl or PHP with their JavaScript & cook it up like gumbo. Some add a smidgen of Flash while they're at it. And then they complain because nobody's browser will run it.

      DOM detection is such a P.I.T.A. (and I don't mean middle eastern bread ;-)

      Maybe the "D" in DHTML stands for "duh"...

      --
      "Obviously, I'm not an IBM computer any more than I'm an ashtray" (Bob Dylan)
  21. Re:the steps by Anonymous Coward · · Score: 0

    1.Everyone type as root: rm -rf / C:\>rm -rf / 'rm' is not recognized as an internal or external command, operable program or batch file. C:\> Windows is apparently not vulnerable to your 1337 social enginner hax0ring techniques.

  22. Parasite-free link by Anonymous Coward · · Score: 0

    And here is the referral-free link. (I got the URL right this time.)

    This guy does this in every book review- he posts an Amazon link quietly incorporating his referral ID, and it immediately gets an "Informative". Leech.

    1. Re:Parasite-free link by Anonymous Coward · · Score: 0

      so you'd rather give those 50 cents to Big Corporate Amazon than to some loser who spent 5 seconds checking that it was cheaper and posting a link? What are you, a Republican or something?

      Don't even try to ridicule my common sense opinions by bringing Republicans into this.

      If someone wants to post a referral link to Amazon, they should SAY it's a referral link, and that please, won't you help me out and use this link, I'm an unemployed coder, I need the five cents to get my teeth fixed, etc.

      At least then I know then that the link is an advertisement. There are restraints placed on commercial speech to protect the public interest (no thanks to Republicans!) and an advertisement that hides the fact that it is an advertisement runs afoul of them.

      I personally might be willing to buy a book through a referral link that was advertised as such. If I saw a chance to help out an unemployed or underemployed techie, I might even pay a few dollars EXTRA to use the damn link.

      Don't flatter yourself into thinking that everyone who disagrees with you is a Republican.

    2. Re:Parasite-free link by Anonymous Coward · · Score: 0

      So you'd rather whine about "Big Corporate Amazon" than get off your luser ass and get a job so you can afford the book? What are you, a Democrat or something?

    3. Re:Parasite-free link by Anonymous Coward · · Score: 0

      That's not a paid advertisement, dufus. It's a useful piece of info telling you how much cheaper it is at amazon. The loser who posted it only gets something out of it if you click on it and buy the damn book, which he should get for going to the trouble to figure out that it was cheaper and providing a link directly to the item.

      It should be +5 informative.

      You're just a sore loser for not posting your own link first...

    4. Re:Parasite-free link by Anonymous Coward · · Score: 0

      That's not a paid advertisement, dufus. It's a useful piece of info telling you how much cheaper it is at amazon.

      Oh come on, WTF? You sound like a spammer defending his "important information about valuable offers". Of course it's cheaper at Amazon. Most books are. They try to ding you on shipping.

      The loser who posted it only gets something out of it if you click on it and buy the damn book, which he should get for going to the trouble to figure out that it was cheaper and providing a link directly to the item.

      Yeah? What if Amazon isn't the cheapest place to buy the book? How do I know he's truly reporting the cheapest source he knows of? The presence of the referral ID means he has an obvious conflict of interest, and should at least state that he has a conflict of interest. Even people in the Bush administration know to do that much (although they don't have the decency to actually follow up with resignations from their lucrative positions in the private sector).

      You're just a sore loser for not posting your own link first...

      I'm still pulling in my boom-year salary, so I'm not stacking Amazon referral pennies yet.

    5. Re:Parasite-free link by Anonymous Coward · · Score: 0

      what are you, stupid? "ding you on shipping"? Can you read the original post? It says: FREE SHIPPING. and he never said "cheapest", he said "cheaper"

    6. Re:Parasite-free link by Anonymous Coward · · Score: 0

      what are you, stupid?

      No, I'm not stupid- I didn't read the parent posts carefully because I was at work and I don't like to spend time proofreading /. posts at work. But since I'm posting as an AC, I don't even have to spend the energy to convince you I'm not stupid, do I? So yeah, consider me stupid. What do I care? I'm already a coward.

      Tell you what: next time you post your referral link, warn us it's a referral link, and you won't have any problems with this particular AC pointing it out for you and calling you a parasite! You won't have to spend time defending yourself, and talking about yourself in the third person like an idiot. I might even buy the damn book through your link if you don't give me the impression you're trying to con me.

      See you at the next book review!

  23. 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."

    1. Re:Is there work for a pure DHTML programmer? by Rahga · · Score: 1

      I have a page that wants to disagree with you, my Nekketsu Street Basket page, with the Javascript-based password generator at the bottom of the page. In this particular case, using static Javascript to create dynamic content on the fly is far superior to using any type of webserver-based technologies, especially when you consider the processing and bandwidth overhead. The only problem comes with browsers that do not support Javascript... Opera, IE, and Mozilla can supports it with no problems, that leaves nothing more than lynx and a few others. Even then, there's a nice message displayed that says the password generator won't work on those browsers, so it's covered.

      I'd rather pay $40 an hour to a decent programmer who deploys the proper solutions in various situations than $20 to the black-belt programmer that does nothing but "Java servlets and JSP".

    2. Re:Is there work for a pure DHTML programmer? by loxosceles · · Score: 1

      Maybe because static pages load much faster than pages with server-side scripting/programming, given the same hardware. You can get millions of hits a day on static pages with minimal hardware. Start using mysql with jsp, php, or whatever, and you have to get some decent machines.

    3. Re:Is there work for a pure DHTML programmer? by entartete · · Score: 1

      there are more things in heaven and earth than are dreamt of in your programming platform of choice. having seen the horrible excuses for UI that most 'hardcore' programmers try to pass off on unsuspecting victims i can understand why they can't compete with people who are skilled in providing elegant interfaces and interactivity to the end user. especially so if they can't understand what works best client side and what belongs server side. plenty of room for specialists out there, though you aren't going to get a very good one for $20 an hour.

    4. Re:Is there work for a pure DHTML programmer? by carlback · · Score: 1

      yes probably not for a pure dhtml programmer, but for a programer that uses that uses dhtml/javascript and jsp/servlets to create lighter weight and more interactive pages and load page sections on the fly so you don't have to update the full page, and do xml/xslt trasformations to create dhtml widgets from the javascript soap request you just fired off and on and on there is work, trust me i know.

      like i keep telling and proving to my boss, i can save a ton of logic and bandwidth on the backend by makeing the client just a little bit smarter and interactive.

      neither technology is a replacement for the other but together you can do some really cool and useful stuff.

    5. Re:Is there work for a pure DHTML programmer? by LordWoody · · Score: 1

      You are partially correct. The real dynamic content and interactivity comes from a combonation of DHTML and server side coding (eg: perl, php, asp, etc...) I have several pieces of work where the dynamic comes from php or perl and the interactivity assist comes from javascript created/modified by the php/perl. Need to dynamically repopulate select boxes? Create the various javascript arrays in php and then use on tags to load/unload the arrays.

      To do this kind of work requires a good understanding of DHTML and the server side language involved.

      --
      Never meddle in the affairs of dragons,
      for you are crunchy and good with catsup.
  24. Not Microsoft by CausticPuppy · · Score: 2, Informative

    or rather, not JUST microsoft.

    DHTML itself is not a technology... it's simply a method of using existing technologies (javascript, CSS, HTML form elements, etc) to create client-side dynamic web pages.

    Microsoft and Netscape both created implementations of DHTML which were largely incompatible with each other, leading to many programmer headaches.

    W3C is working on a standard as we speak, which is largely dependent on the standardized Document Object Model.

    More info...

    http://www.talltech.com/student/imos98student/j_ ch u/dhtml/standards.htm

    Microsoft's existing standard will be very close to the final W3C standard. Netscape's was even more proprietary because it introduced new tags that are not even in the HTML 4.0 standard (Layers, anyone?)

    --
    -CausticPuppy "Of all the people I know, you're certainly one of them." -Somebody I don't know
    1. Re:Not Microsoft by rossz · · Score: 1

      Thanks for the clarification. However, I would prefer Microsoft get their CSS implementation to meet the existing standards before going off to implement something brand new that has not been finalized. It's a pain in the ass to have to code two style sheets just because Microsoft gets too many basic things completely wrong.

      --
      -- Will program for bandwidth
    2. Re:Not Microsoft by djeaux · · Score: 1
      Microsoft's existing standard will be very close to the final W3C standard. Netscape's was even more proprietary because it introduced new tags that are not even in the HTML 4.0 standard (Layers, anyone?)

      Is this a time warp? Netscape deprecated layers with version 6.

      I don't mind a defense of Microsoft, but please do it with 2003 examples!

      BTW, http://www.talltech.com/student/imos98student/j_ch u/dhtml/standards.htm was /.ed or just plain not online. Looking at the URL, I'm led to believe this was a student paper from 1998 submitted in a category called IMOs. Student opinion from 5 years ago?

      --
      "Obviously, I'm not an IBM computer any more than I'm an ashtray" (Bob Dylan)
    3. Re:Not Microsoft by CausticPuppy · · Score: 1

      However, I would prefer Microsoft get their CSS implementation to meet the existing standards before going off to implement something brand new that has not been finalized. It's a pain in the ass to have to code two style sheets just because Microsoft gets too many basic things completely wrong.

      No argument there. But having something ratified by W3C is certainly a good thing. At least the standard will exist, so that we'll know exactly how Microsoft is violating it!

      --
      -CausticPuppy "Of all the people I know, you're certainly one of them." -Somebody I don't know
    4. Re:Not Microsoft by CausticPuppy · · Score: 1

      Is this a time warp? Netscape deprecated layers with version 6. I don't mind a defense of Microsoft, but please do it with 2003 examples!

      The original poster was referring to the beginnings of DHTML, and I was clarifying on that point. This was the late 90's time frame.

      And yes, the site did appear to go down inexplicably...

      --
      -CausticPuppy "Of all the people I know, you're certainly one of them." -Somebody I don't know
    5. Re:Not Microsoft by rossz · · Score: 1

      The link works perfectly if you remove the space in the middle of the url.

      --
      -- Will program for bandwidth
  25. Maybe ... by A+nonymous+Coward · · Score: 1

    ... I drink milk :-)

    What goes around comes around.

  26. DHTML = Script manipulated HTML by JohnDenver · · Score: 2, Informative

    What DHTML is not

    While Dynamic HTML can be simplified as JavaScript + HTML + CSS, I can think of many instances where these technologies are use and it still can't be considered dynamic HTML.

    Ex: Using JavaScript to validate a form is not DHTML.

    DHTML - My definition

    Dynamic HTML - Any HTML content that is either dynamically created or altered by a client-side scripting language such as JavaScipt or VBScript.

    To put it simply: If you're changing the page layout on the fly, then you're doing Dynamic HTML.

    --
    "Communism is like having one [local] phone company " - Lenny Bruce
    1. Re:DHTML = Script manipulated HTML by aflat362 · · Score: 1

      Thank you. You've confirmed my suspicions. What is the POINT of calling something "Dynamic HTML" if all it is is a regular damn HTML page with some JavaScript and CSS? I agree with your opinion that simple javascript in a page doesn't make a page Dynamic. However, I also think that no matter WHAT you do with JavaScript or Style sheets you aren't doing any DHTML at all. You are doing JavaScript and Style Sheets! Dynamic HTML. . . Bah!

      --

      Conserve Oil, Recycle, Boycott Walmart

    2. Re:DHTML = Script manipulated HTML by jo42 · · Score: 1


      Yeppers, DHTML, yet another buzzword, just like XML, which is text file with tags that only your application can understand...

    3. Re:DHTML = Script manipulated HTML by aflat362 · · Score: 1

      XML at least has a standard format and syntax, even a couple of pre-defined entities. The biggest benefit comes from XML parsing libraries (though I have yet to sucessfully figure out how to use them to read XML). I agree with you that it is a pretty flimsy "language" or what have you but it is less of a buzzword than DHTML.

      --

      Conserve Oil, Recycle, Boycott Walmart

  27. SoBig.G Source Code Request: +1, Patriotic by Anonymous Coward · · Score: 0


    Would someone please point to a URL with the
    source code (for research purposes only)

    Very truly yours,
    Jon_Katz's_Commodore_64_programmer_in_Afgh anistan

  28. nope by Anonymous Coward · · Score: 0

    sorry not funny.

  29. What problem? by djeaux · · Score: 2, Insightful
    BTW, can anyone spot the problem with this code:

    Sure can. You redefine the variable i. Departing radically from /. convention, I actually pasted your code into my trusty text editor to see if there was some cool trick that I didn't notice just reading it & found that it behaved exactly as I expected:

    1. myfunc1() passes 0 (zero) to myfunc2() on the first iteration of the myfunc1 loop.
    2. myfunc2() then increments i stepwise to 14 whereupon it returns to myfunc1() & ends because 14 > 10.
    In fact, this same code (with slight syntax changes) produces the same result in Perl unless 'i' is localized in each function & the value passed to myfunc2 is handled as @_. I'm pretty certain the result would also be the same in C, but here I bow to laziness & /. norms. In fact, I would regard a different outcome as a "problem". :-D

    Are you trying to illustrate the sloppy code that happens because JavaScript is easy & free & a bunch of folks with no concept of good coding practice can just kludge away? Or is there something more substantive to the example?

    --
    "Obviously, I'm not an IBM computer any more than I'm an ashtray" (Bob Dylan)
    1. Re:What problem? by AKAImBatman · · Score: 1

      Are you trying to illustrate the sloppy code that happens because JavaScript is easy & free & a bunch of folks with no concept of good coding practice can just kludge away?

      Basically? Yes. The long answer is that you are never required to define your variables, thus producing the problem. You cannot run into this problem in C, because you'd have to define "i" first. If you're still using a global variable, then it's your own damn fault. It should be painfully obvious what the problem is in that case. The problem in Javascript is that it *isn't* painfully obvious. Since code works the same (in coder's eyes) if you type "var i;" or if you don't type "var i;", why should you waste your time typing "var i;"?

      Again, with decent engineering of code, Javascript isn't half bad. The fact that it does absolutly nothing to encourage said engineering is a failure of the part of the language. (Especially given its namesake.)

  30. The Web Programmers Cross Reference by porkrind · · Score: 1
    "The Web Programmers Cross Reference" from No Starch Press is a complete reference guide to HTML, Javascript, CSS, and DHTML. When I say complete, I mean every HTML tag with browser version compatibility, every Javascript function, every CSS directive, and a bunch of stuff on MS-isms for web programming (kind of necessary, even if a tad evil) Check nostarch.com for more information - should be taking pre-orders next month or so, and the final printed version should be in stores by December.

    (yes, I am a No Starch Press employee)

  31. Definitive JS book... by porkrind · · Score: 1
    Is the thau! book from No Starch Press - Book of Javascript page. It's a great book and received great reviews.

  32. DHTML is basically JavaScript? by Anonymous Coward · · Score: 0

    Ummm no. DHTML refers to the ability to change the properties of HTML elements dynamically. You can USE JavaScript to change the properties of HTML elements. But you could also use VBScript, or any scripting language that allows you to modify the document object model.

  33. Learning from source code by Anonymous Coward · · Score: 0

    I've always found that learning from actual example programs or source is one of the quickest and best ways to learn.

    Anyone looking at enhancing their javascript or DHTML should take a look at Oddpost and Convea which are two of the best web applications using javascript and DHTML.

  34. What is needed is DISCIPLINE! by djeaux · · Score: 1
    Again, with decent engineering of code, Javascript isn't half bad. The fact that it does absolutly nothing to encourage said engineering is a failure of the part of the language. (Especially given its namesake.)

    The same could be said for Perl, except that there is "use strict". And "use strict" always brings to mind the image of a leather-clad female software engineer threatening the coders with a whip & chain... Ok, ok, so I'm a pervert ;-)

    So, shall we tie up JavaScript kludgers & force them to submit to some form of "use strict"? Discipline is what they need! Heck, I might write some bad code just to meet that leather-clad supervisor!

    --
    "Obviously, I'm not an IBM computer any more than I'm an ashtray" (Bob Dylan)
  35. Beware: This book is not for everyone... by brundlefly · · Score: 2, Interesting

    I bought this book, thinking that if it is anywhere near as useful as the Perl Cookbook, then I would be getting my US $39.95 worth. I was very disappointed with the book and would not recommend it to JavaScript/DHTML experts.

    The problem with this book is that is almost completely tailored to the person who hasn't much experience with these technologies. For example, the section on the String object gives newbie tips like:

    Use += to concatenate strings.

    (Whoo-hoo! Thank you Danny Goodman, where can I mail my check to?)

    In this very same section on String concatenation it completely fails to discuss the geometric performance loss experienced as strings become larger and larger. Why wouldn't you discuss this? What I would expect to see is a discussion of how you can implement your own version of a StringBuffer, similar to Java, by using Array operators.

    There is almost no discussion of client-side XML, absolutely nothing on XSL. If you do much dynamic in-place refresh of data or styles, this book will not help you much.

    The book might be fine for novices and maybe even intermediate developers, but for experts it falls very flat. I skim the book once a week or so hoping to glean something new, and I'm always disappointed. Caveat Emptor.

    If you are a serious developer you should probably just have your employer buy you a subscription to the O'Reilly Safari online bookshelf, and then you can see for yourself whether or not this book is any help to you.

    (BTW, for those have said that you cannot get work as a DHTML programmer, you are so wrong. I make a comfortable six-figure salary doing this work for governments and large corporations. If you are good enough at what you do you can always find someone willing to pay you for it, and DHTML is no exception.)

  36. Javascript nonstandard and nonproductive by bradbury · · Score: 1

    To the best of my knowledge Javascript is not a standard language approved by a "standards" making body (e.g. ANSI, ISO, etc.). It will also routinely crash or cause errors in Netscape browsers and/or suck up CPU time better devoted to distributed computing projects. The reasonable thing for an intelligent user to do is to browse the web with Javascript disabled. Who knows what security holes may lurk in Javascript code? More information on why not to use Javascript and how to write code that makes the clients happy (i.e. it downloads fast) is here.

    1. Re:Javascript nonstandard and nonproductive by allcrispy · · Score: 1

      Sorry to contradict you; javascript is at this moment merely a common name for the ECMAScript implementations. ECMA (http://www.ecma-international.org/) is an organisation for standardisation simular to ISO. Javascript implementations (currently JScript5.5 in IE6 and JavaScript 1.5 in Netscape/Mozilla as wel as Actionscript for Flash) are all based upon the ECMAScript V3 standard. The page you are referring to is obviously outdated (P100? NS4.x?); it is true that in the past there was no real standard for javascript (actually, Netscape invented it - originally called LiveScript) and there have been security issues. That however is a thing of the past...

  37. Come on... by pb9494 · · Score: 1

    ...how much did they pay you to write this review ? I mean, it's probably a good book, but who needs a book on JavaScript ? There's plenty of info on the web; I can't think of _any_ book that's worth buying when it comes to mainstream software development. Dead tree format study guides are so 20th-century...

  38. DHTML Lemmings! by Doppler00 · · Score: 1

    So after reading this book, would I be able to do something like this ?

    DHTML might be a good altervative to Java in the future for some web based interfaces, considering that a decent version of Java does not come with Internet Explorer anymore.

    1. Re:DHTML Lemmings! by allcrispy · · Score: 1

      Probably not; it took me 3 years to get to the point of making this, and basically browsers aren't quite ready for it. Requirements are high, and there are bugs in certain browsers (Linux version of Mozilla for instance, and Safari/Konqueror) that make it unplayable (I'm trying to find work-arounds though). DHTML at this level is just maturing, and this is just an example of taking it to the edge (and then the Lemmings fall over :) )

  39. Actually, DHTML is a real and specific thing by JohnDenver · · Score: 2, Informative

    I don't you followed my definition:

    Dynamic HTML is a real and valid term which covers:

    1. Dynamically creating HTML on the client.
    2. Dynamically altering HTML on the client.

    You *ARE* doing Dynamic HTML if you are using JavaScript and CSS to *DYNAMICALLY* create/alter HTML on a page.

    You *AREN'T* doing Dynamic HTML if your use of JavaScript and CSS neither creates or alters the HTML on a page.

    In conclusion: Dynamic HTML is the process of dynamically creating and altering HTML in a web page.

    (Sorry for being super-redundant)

    --
    "Communism is like having one [local] phone company " - Lenny Bruce
    1. Re:Actually, DHTML is a real and specific thing by aflat362 · · Score: 1
      You confirmed my suspicions that DHTML was nothing more than HTML + JS + CSS.

      I do agree that you are "Doing Dynamic HTML" if you create / alter HTML on the fly.

      BUT the buzzword (and apparently that's all it is) DHTML is thrown around so much that they (users of the word DHTML) make it seem like it is its own language. Example:

      Newb: " I want to learn to be a web programmer, What should I learn?"

      Some Idiot:" You should learn HTML and DHTML. Then you will be set."

      Then the newb goes out looking for a DHTML language reference but guess what: The language doesn't exist.

      --

      Conserve Oil, Recycle, Boycott Walmart

    2. Re:Actually, DHTML is a real and specific thing by jc103 · · Score: 1

      Your suspicion is right - usually the components are as follows:

      DHTML = (XHTML || HTML) + (DOM || JS) + CSS

      Then the newb goes out looking for a DHTML language reference but guess what: The language doesn't exist.

      An excellent point, which shows the problem in not only trying to learn 'DHTML', but dismissing learning other basic concepts (such as DOM) thinking it's something other than DHTML.

      Judging by the very general definition at Webopedia, for one to say "I'm learning DHTML" doesn't mean very much..

      --

      --
      Have you read the Moderation Guidelines Addendum

  40. DHTML Lemmings by Anonymous Coward · · Score: 0

    DHTML Lemmings is awesome!

  41. Sure! In web design, and JavaScript components by JohnDenver · · Score: 2, Interesting

    I've found that there is a growing demand for web designers who can use DHTML as an alternative to Flash, especially considering most of today's web-browsers have become considerable more compatible in the last few years.

    You should also note the increasing growing market of selling JavaScript components like Dynamic Menus, Calendar Pickers, Tables, and other goodies.

    Obviously DHTML is only half the solution for most problems, so we find that most DHTML programmers usually use DHTML in conjunction with ASP, PHP, JSP or some other server-side technology.

    Not to mention the learning curve from something like JavaScript to PHP is fairly short. So the incentive to isolate oneself in a DHTML-only world is probably slim.

    --
    "Communism is like having one [local] phone company " - Lenny Bruce
  42. All the Javascript you need! by Anonymous Coward · · Score: 0

    Here's all the javascript you need:

    <script>

    s = "Javascript sucks asteroids thru pipettes!";

    while ( true ) {
    alert("Are you having fun yet?");
    s += s + s;
    }

    </script>

  43. This comment pops up with every book review by Infonaut · · Score: 1

    "Why use a book when x,y,z is available for free on the Internet?

    Well, crap. Why *ever* use a book when the information is already available in electronic form? Why read Tom Sawyer in book form when you can read it on your Palm Zire? Why read the printed newspaper at the coffee shop, when it would be far more efficient to bring your laptop, look for a Wi-Fi network, and read the news online?

    My point is that sometimes online sources are hampered by the medium. The book for all its faults is a wonderful information vector. It's not always best, but it's often worth paying money for; even in the digital age.

    --
    Read the EFF's Fair Use FAQ
  44. Apples and oranges by SoupIsGoodFood_42 · · Score: 1

    There are some things that are just plain clunky to do server-side. Maybe programmers don't understand the value of client-side scripting--obviously you don't, but users (as long as you have a noscript alternative) and sysadmins certinaly do.

  45. A toast for prototype-based languages! by Anonymous Coward · · Score: 0
    function f() {
    this.style.left += 10;
    }
    function g() {
    this.style.left -= 10;
    }
    function addEvHandlers() {
    docimg = document.getElementsByTagName("IMG")
    for (var i=0; i<docimg.length; i++) {
    docimg[i].onMouseOver = f
    docimg[i].onMouseOut = g
    }
    }
    ...
    <body onLoad="addEvHandlers">
  46. Re:bookpool is even cheaper by moof1138 · · Score: 1

    Bookpool has it for less than Amazon, BN, or booksamillion. They have free shipping if your order is $40 or more, so this may or may not be a better deal.

    --

    Hyperbole is the worst thing ever.
  47. DHTML: BAH! by tzanger · · Score: 1

    I've banished DHTML and all it encompasses. XWT is what I use now... No browser bugaboos, straight JavaScript, OSS, multiplatform, fast, client/server and perfectly clear separation of content from presentation.

    Screw DHTML. XWT is the future.

  48. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  49. Re:DHTML and javascript 8) by DrSkwid · · Score: 1

    thanks, well, it has been a while

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  50. Re:first post cookbook by MrBlint · · Score: 1

    And you nicked my sig

    --
    That's very perceptive of you Mr Stapleton and rather unexpected in a G Major
  51. HTML Student by jazzyscorpion · · Score: 1

    I appreciate your insightfulness on this book. I am currently finishing up on a core req. class on HTML. I am anxious to move on. Jazz

  52. JavaScript Libraries by pmsyyz · · Score: 1

    A good anti-JavaScript Libraries article:
    Keep JavaScript Simple By Peter-Paul Koch

    --
    Phillip