News for hackers. Stuff that matters.
Re:Don't wait for "DOM ready" for your app to start by gkoberger on Friday June 08, 2012 @08:37PM (#4086783)
At Mozilla, we were losing a few add-on download clicks because of the lag from putting the JavaScript at the bottom. So, we created a tiny bit of JS that recorded important events, which we loaded in the <head>. The queue re-fired off the events once the JavaScript loaded.

https://github.com/mozilla/zamboni/blob/master/media/js/impa...

Re:Don't wait for "DOM ready" for your app to start by voidfiles on Saturday June 09, 2012 @01:09AM (#4087263)
So, the code you post requires jQuery, I am assuming, because you don't say. Which means you would need to also include jQuery in the header. Doesn't that seem like a waste? Also if you had jQuery already you could probably writing a queuing system for almost all actions, and not just "important" ones.

You should take a queue from Flickr. I took a look at how they handled this, and I think it's one the best I have seen so far.

http://dailyjs.com/2011/11/28/flickr-async/

The method there could actually be a small amount of code, and wouldn't require that you load jQuery before queuing events.

Re:Don't wait for "DOM ready" for your app to start by cheatercheater on Saturday June 09, 2012 @07:50AM (#4087880)
> because you don't say

Use the source, Luke!