BeginningJavaScript.com - Get the code and information about ‘Beginning JavaScript with DOM Scripting and Ajax’

I am proud to announce that my book has been shipped out the printers and will be available soon-ish in the shops or arrive at your places when you pre-ordered it.

Cover of Beginning JavaScript with DOM Scripting and Ajax

I used the better part of my freetime (that is normally spent on personal grooming) of the last 7 months writing it on my trusty T42 IBM laptop on the tube to work, in restaurants, cafes and other people’s houses.

The outcome is pretty impressive though:

  • Over 500 pages of text
  • 207 HTML examples
  • 104 JavaScript files
  • 14 PHP files
  • 55 CSS files
  • About 30 bad illustrations

You can get all the information about it and download or check out the code examples at http://www.beginningjavascript.com

I hope I succeeded in delivering a book that will help beginners get the basics of JavaScript and will also help seasoned developers to brush up on old practices.

Anyways, the next one is in the making…

25 Responses to “BeginningJavaScript.com - Get the code and information about ‘Beginning JavaScript with DOM Scripting and Ajax’”

  1. Frank Michlick Says:

    Good stuff Chris!

  2. Ian Lloyd Says:

    Congratulations Chris - It’s a nice feeling to see the fruits of your labour, isn’t it?

  3. Rob Wilmshurst Says:

    Looking good; I’ve been waiting for this since you piqued my interest back in January at the Geek Dinner. I’ve got a copy on order from the local bookshop (actually I’m pretty sure it’s now a costa coffee - who owns who eh?) and am looking forwards to it.

    Congratulations!

  4. Michel Says:

    Congratulations!!!

    Good work!

    I’m heading now to the website with the examples ;-)

  5. Jules Says:

    I am looking forward to reading this book because I am concerned that newbies to JavaScript would learn DOM scripting (from the books available in the past) after learning 1995-methods of JavaScript from which some students wouldn’t progress.

    How can newbies become the New Web Professionals if they learn only the old, improper methods? Books that teach, from the outset, how to use the proper methods right from the outset will create these new professionals.

  6. Brett Merkey Says:

    Excellent and valuable book — and I just uploaded a review to Amazon U.S. to tell everyone else the same thing. Keep up the good work and hope to learn more good coding from you.

    Brett Merkey

  7. Chris Heilmann Says:

    Wow, Brett, thank you for that raving review :) Good spotting of the typos, as you can see that was a printing and rewriting issue. When the book was almost done we realised that the code layout had to be changed and these glitches were caused by these hasty changes :-(.

  8. Adam Says:

    Your book is very bad. You don’t explain a shit about DOM. In every example you use your own helper library called “DOMhelp”. And I don’t have an idea of what that fucking library does. For example on page 124 you use the method DOMhelp.addEvent() and you haven’t explained what it does.

    I’m really angry right now. I thought it was a good book. But its not.

  9. Chris Heilmann Says:

    Dear Adam,

    I am sorry to read this kind of comment, especially as it is based on a misunderstanding.

    I also thank you for bringing this up, as I will put this explanation on the book’s site as well. I’d have liked to send you a personal email and give some compensation for you frustrating experience but as you haven’t given me any details, I can’t do that. :-(

    Consider this:

    I just bought a book by Dostojevksi and checked the last chapter. I am very annoyed that I don’t know any of these characters and feel lost. He clearly is a bad writer and I have been cheated out of my money!

    I then picked up a Sherlock Holmes story and the writer talks about someone helping Holmes in case he needs him, and I just don’t get any more information about this guy. Surely I am entitled to do so, as the rest of the story is useless without this information. What do I care about other plots, players and happenings unless I know all about that guy? Clearly another bad writer.

    The DOMhelp library is introduced in Chapter 4 on page 115, where I also explain that

    “You’ll find the DOMhelp.js file and a test HTML file in the code demo zip file accompanying this book—the version in the zip has more methods, which will be discussed in the next chapter, so don’t get confused.”

    I introduced the DOMhelp library to shorten the other code examples and allow you to concentrate on the functionality explained and of utmost importance in the current examples. All addEvent() does is start the other scripts when the page is loaded. When you claim you don’t know what DOMhelp.addEvent() means, would you have felt better if I had used the following?

    if (elm.addEventListener) {
    elm.addEventListener(evType, fn, useCapture);
    return true;
    } else if (elm.attachEvent) {
    var r = elm.attachEvent(’on’ + evType, fn);
    return r;
    } else {
    elm['on' + evType] = fn;
    }

    Events are the most complex bit about modern JavaScript and the second half of chapter 5 explains in detail what events are, how they work and you get to know the different ways to make them work with buggy browsers – which all makes up addEvent().

    DOMhelp is not “my library”, but is used and assembled throughout the book. I used the addEvent() in the examples already as I didn’t want to follow old practices and keep all the examples in the book on a very high and unobtrusive standard – something that is explained in Chapter 3 “From DHTML to DOM scripting”, which speaks in detail about how to use the DOM.

    I am sorry that you got confused about this, and I hope that this explanation makes you understand the logic behind not explaining addEvent() as the first bit of the book. You cannot explain someone how to write a Word Macro when they don’t even know yet where to find and how to open Word.

  10. Patrick Kellogg Says:

    Chris,
    Really good book. You are an excellant writer. What’s the topic of your next book? Thanks again. Patrick Kellogg, Pavones, Costa Rica

  11. Rafael Says:

    i just started reading your book and i wish it had a dedicated forum, as some books do; anyway, i’m stuck with my first doubt: in last example from chapter 1 you have some code that prints users resolution and, now appears my concern, shouldnt it also print a line, inside head, with a link to apropriate stylesheet? because i cant see it happen. I’d like to be clarified about it.
    ty

  12. Rafael Says:

    never mind my previous comment: browser indeed reads new link to apropriate css file, though i cant see it

  13. Akhil Says:

    I just went through the official site of the book. It smells really fantastic. I noticed that in ‘The Book’ page, title is given ‘About the Author Chris Heilmann - Beginning JavaScript’. I think its a mistake or am I missing something. Hope I have not come to the wrong area.

  14. Curtis Says:

    Hi Chris,

    Good book, Great examples - I still hate coding Javascript but this makes it a bit more tolerable.

    Here’s a question for you. Chapter 7 — exampleLinkedAnchorsPanels.html

    It seems that FireFox does not reload the page when you go directly to an anchor through the address bar. Like this

    exampleLinkedAnchorsPanels.html#demo

    I have to hit refresh for it to load correctly.

    Is there a work around for this?

    It does work of course when you clink the link. Works in IE did not test else where.

    Cheers!

  15. Rafael Says:

    i dont understand the need of a space, when you refer to it at pag 106, 2nd paraghraph.
    also, if i try your code (exampleCheckDateErrorMessage.html/CheckDateErrorMessage.js) and remove the space from line 9 (errorContainer.firstChild.nodeValue=”;), the example also works perfectly, but, if i remove the space from html page (line 19) i get an error; could you explain it, please?
    TiA

  16. Nick Toye Says:

    Hi Chris,

    I won your book at a WSG meeting in London last year, but I’m only just getting around to working through it.

    Anyway, I have the same issue as the guy further up the page who decided to rant and rave and use quite obnoxious language about someone’s hard work.

    I felt confused because I was wondering why my link didn’t appear at the start of Chapter 5, it turns out it was because the addEvent wasn’t present even though the code at the start was calling it. It wasn’t for another 40 pages before it was described. So I felt it was misleading and confusing. As you don’t really explain why the link isn’t working.

    If the book never said Beginning… at the start of the title, I wouldn’t expect to have everything explained, but I am a novice and its things like this that put me off learning a language.

    So it really should be present earlier in the chapter.

    Otherwise, thanks for a great book.

  17. rizla Says:

    I just bought the book and while reading it i would like to mark one point that i think needs some improvement. It concerns the info about js objects. There is not enough explanation about what a js object is and how to create a custom one.
    There is some information on chapter 2 but it sticks on how to use objects and not on how to create (no info on object creation even when you create the first object in the book - DOMHelper).
    Also i think there should be a chapter explaining some prototype script languages aspects from the js view.
    Beyond these as far as i have read its a great book even for the very beginners of js language covering all of the modern javascript aspects.

  18. kuzmich Says:

    Hi, want to ask you about the code I’ve found on the page 104:

    function lastSibling(node){
    var tempObj=node.parentNode.lastChild;
    while(tempObj.nodeType!=1 && tempObj.previousSibling!=null)
    {
    tempObj=tempObj.previousSibling;
    }
    return (tempObj.nodeType==1)?tempObj:false;
    }
    function firstSibling(node)
    {
    var tempObj=node.parentNode.firstChild;
    while(tempObj.nodeType!=1 && tempObj.nextSibling!=null)
    {
    tempObj=tempObj.nextSibling;
    }
    return (tempObj.nodeType==1)?tempObj:false;
    }

    Don’t you think that the “while” conditions are wrong or I understand something wrong. If we want to find the last sibling we should check: tempObj.nextSibling!=null? And the opposite for finding the first sibling.
    Thank you

  19. kuzmich Says:

    My excuses, thee functions are fine

  20. Asad Says:

    I am using the book.
    The slide show with the DOM, the image count (ie 2/4) is shown only until ten. When it reaches 11 it shows something like 110/11.

    Help Please.

    thank

  21. Peter Says:

    The book is very clear and well written. However, there’s a serious omission; much more needs to be said about the limitations imposed on Javascript by browsers. Although it’s briefly touched upon at the start of the book in ‘Problems and Merits’, it’s implied there that only people with browser security set to ‘paranoid’ will have problems. . .However, if I try to run the first example from the book here on this site on a totally standard installation, I get ‘This website is using a scripted window . . . ‘
    Worse, if I ‘click here to allow…’ I still don’t get the Input window.(I’m using IE7 on Vista)
    Sorry, but if the very first example doesn’t work as advertised . . . . .

  22. hehe Says:

    hello,i am confused on this book page 111,
    for (i=0;i<inputs.length;i++)
    {
    if(inputs[i].getAttribute(’type’).toLowerCase()!=’submit’)?
    {continue;i++}
    ……
    }
    the i++ followed the continue,i don’t know what’s the meaning of this,i took it off,the code still runs all right,but i am confused…

  23. Chad Says:

    Hi Chris,

    I am familiar with HTML and CSS but any other programming is new to me. After going through the first four chapters of this book I still feel completely clueless about using JavaScript. Being a beginner, are there other references I should check out first or will the book begin to tie things together with real applications of JavaScript? I appreciate your feedback as I really want to learn programming but feel a bit lost.

  24. Chris Says:

    A good book.

    However chapter 6 the PhotoListInlineSlideShow if the number of images on this goes into double figures the counter at the bottom fails to operate properly i.e. image 11 will be “110 of X” and 12 “1210 of X” I have looked at the scripting with my knowledge (intermediate at best). Is there a solution to this it would be much appreciated.

    Again the general knowledge in the book however is very well explained.

  25. Andy Says:

    Enjoying the book. It’s really helping me to build a solid foundation of good coding practices. Thanks!

Leave a Reply

@mediaAjax
Scripting Enabled - hacking the web to be more accessible - London, England 19th and 20th of September 2008
Wait till I come! is the blog of , a developer evangelist living and working in London, England. Download vcard.

Feed me, Seymour: Entries (RSS) and Comments (RSS).