Hacker News new | past | comments | ask | show | jobs | submit login
DOM Enlightenment (domenlightenment.com)
94 points by jarek-foksa on Nov 10, 2012 | hide | past | favorite | 6 comments



Summary (since it's not obvious from the title): this is a free e-book about "exploring the relationship between JavaScript and the modern HTML DOM".

From the introduction: "This book is not an exhaustive reference on DOM scripting or JavaScript. It may, however, be the most exhaustive book written about DOM scripting without the use of a library/framework. The lack of authorship around this topic is not without good reason. Most technical authors are not willing to wrangle this topic because of the differences that exist among legacy browsers and their implementations of the DOM specifications (or lack thereof).

For the purpose of this book (i.e. grokking the concepts), I'm going to sidestep the browser API mess and dying browser discrepancies in an effort to expose the modern DOM. That's right, I'm going to sidestep the ugliness in an effort to focus on the here and now. After all, we have solutions like jQuery to deal with all that browser ugliness, and you should definitely be leveraging something like jQuery when dealing with deprecated browsers."


The DOM ain't all that bad, really. The names for some things are a little verbose, sure, but it's not really difficult to deal with. Especially if you're creating elements to build up a page, from JavaScript, instead of querying existing elements.

I've used it recently to build ponyplace (http://ponyplace.ajf.me/), a MLP:FiM-themed chatroom. The only thing I did find to be an issue was the fact that DOM lists returned by getElementsByClassName etc. change to reflect the removal of elements they contain - really bites you if you're trying to remove all elements of a given class.


Thanks.


very nice and thanks for contributing what looks like a good resource! I'd be interest to know how you went about organizing the research for this? I've read webkits WebCore source and its pretty enlightening did you go that way or was this really dissecting the agggh incredibly intersting spec docs?

Also as a minor note, I know this a rough draft but have you thought about the code syntax styling? Its not that its bad at all, its just I think it could be more readable with some color differntiation :)


I read the specs and tried to bring out the modern key parts with a focus on what I thought a developer should know or be aware of. The reason you don't see much written about this topic is the specs are not easy to read in relationship to each other. What do you suggest for syntax styling?


This is awesome. Tackling the dom in a comprehensive and library-agnostic way is what I need right now.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: