I might as well come right out and say it: I’m starting work on my second JavaScript book. My first one was something of a success; it has gotten great reviews and is in its 3rd or 4th printing (I lose count). I’m in the process of pulling together materials, building outlines, and talking with publishers to make this next one happen.

I have another question, related to my previous one, that’ll help me to sculpt the direction of the book.

What are the greatest untold secrets of JavaScript programming that you wish were thoroughly debunked and explained?

I’d like to keep things rather specific and precise, rather than generic. For example, I’m looking for secrets like “How do I get my animations to be so smooth?” rather than “How do I make an awesome accordion menu?”. Questions about how specific libraries do things is perfectly fine, too (doesn’t have to be just jQuery – I’m well versed in most of the major libraries).

Here’s some that I’ve noticed:

What is (function(){ })() and why is it so fundamentally important to modern JavaScript development?

and why is it so fundamentally important to modern JavaScript development? What does with(){...} do and why is it so useful?

do and why is it so useful? How can arguments.callee change how I work with JavaScript code?

change how I work with JavaScript code? How exactly do timers work and how can I best use them?

How do I identify and tackle memory leaks in web applications?

How do I write a cross browser way of… Getting/setting attributes. Injecting HTML strings. Getting/setting computed css values. Managing DOM events. Writing a CSS selector engine. Doing smooth animations.

How can I use verification tools (like JSLint) to my advantage – and write my own?

What’s the best way to transmit JavaScript files?

How do I write my own JavaScript compressor (like Packer)?

All of these are giant gaping holes in the world of JavaScript literature and it needs to be fixed. Are there any that I missed?

Aside: I’m phenomenally bored with traditional Ajax/DHTML books, large parts of mine included. There’s no great mystery concerning the DOM API or how to do a simple XMLHttpRequest – and I hardly think there needs to be considerable literature dedicated to it. However, no one talks about how incredibly hard it is to get those things working in a bullet-proof cross browser manner. Probably the best resource we’ve had was Quirksmode – but that only told you what was broken – but not even necessarily how it was broken and definitely not how to fix it. There needs to be volumes written on how to fix real-world JavaScript bugs, constantly being updated to handle the changing browser landscape. Depending on how progress goes with the planning of my book, I’d like to tackle a large number of these issues directly and get them out there so that everyone can learn from all the work that’s being done.