Thanks Christophe for the quick response. That was it. For the sake of other readers: here is what Christophe is pointing out:
var Staff = {
nodes: [
{ id: 'item1', name: 'ACME',
children: [
{ id: 'item11', name: 'IT',
children: [
{ id: 'item111', name: 'Sébastien Gruhier' },
{ id: 'item112', name: 'Alexis Jaubert' },
{ id: 'item113', name: 'Guillaume Réan' }
] },
{ id: 'item12', name: 'HR',
children: [
{ id: 'item121', name: 'Sandrine Daspet' }
] },
{ id: 'item13', name: 'Xavier Borderie' }
] }, <--- This comma is not needed remove it - Per Christophe
]
Now I did that and everything started to work fine. By the way, I just tried your online demo which has the same problem that I had. Therefore, it must have the extra comma in the code as you pointed out. You may want to take care of that.
If I may, I need some advice and guidance from you. I am a Ruby on Rails programmer with more experience in Ruby and Ruby on Rails than the client side Javascripting and Ajax. Recently, I have started diving into the client side coding of XHTML/CSS/Javascript in that order. I find Javascript fascinating but annoying at the same time.
I went thorough Simply Javascript from Sitepoint without much problems and have been dabbling with the Art and Science of Javascript (another Sitepoint publication). I also have the JQuery in Action from Manning which I was going through until I got your book. I have temporarily put it aside since my needs are more Ruby on Rails specific at this point which your book ideally fills.
I find your writing style very very enjoyable. The non-trivial examples that you have in the opening chapter and the Dom chapter are excellent but mind-bending at the same time. I am still not through the DOM manipulation chapter yet and it is slow going, but this is precisely the kind of skills that I want to pick up.
This whole experience with Internet Explorer was an eye opener of sorts. I have been moving along at a fairly comfortable pace in Firefox and Firebug world, but this bug in the IE code threw me off compeletely. Here is the Javascript error message (once I found out how to display it) in Internet Explorer with the incorrect comma.
Line: 84
Char: 7
Error: ‘undefined’ is null or not an object
Code: 0
Not very helpful, indeed. I had no hope of being able to debug it unless you or someone else pointed out the problem.
I have several follow-up questions:
1. How do I go about debugging (or even learning) in the Internet Explorer environment? The reason I ask is that we have to support Internet Explorer for the site that I am responsible for?
2. I still have problems trying to understand the entire code for the DOM chapter. It is definitely my lack of Javascript experience more than anything else. I consider myself as an intermediate Ruby Ruby on Rails programmer. I was stepping through your code using Firefox/Firebug combination in the People3 sub-directory. I think that it is going to be several sessions before I get it. Do you have any suggestions on picking up other concepts before I do that?
3. As a Ruby on Rails developer, how much time should I be investing in learning jQuery?
Regards,
Bharat