News for hackers. Stuff that matters.
Re:Eventual Consistency in Real-time Web Apps by deoxxa on Tuesday June 17, 2014 @11:38AM (#7905014)
I've had a lot of success with embedding initial content for a page as JSON in a script tag with a specific ID and a type of "application/json". This way you can rely on the content being there and sidestep the whole timing issue completely. You can potentially speed up your loading time as well, if you have a bunch of things you'd usually fire additional requests off for.

I believe I got this idea from Backbone's documentation [1] originally, but I've seen it mentioned in other places as well.

[1]: http://backbonejs.org/#FAQ-bootstrap

There are no comments on this comment yet.