In some cases, twitter.com fails to load the timeline with a cold cache. The black toolbar loads, but a JavaScript error prevents the rest of the page from loading. The error is typically something like: TypeError: 'undefined' is not an object (evaluating 'twttr.anywhere.api') See the attached screenshot to see what the page looks like when this happens. The problem seems to be specific to a subset of twitter accounts and usually goes away if you reload the page. Since I am able to see this error, I'll work on a reduction.
<rdar://problem/9491632>
This is a regression due to <http://trac.webkit.org/changeset/67163>
There is a JavaScript function in the main document called initAPI() that calls twttr.anywhere.api.initialize(). twttr.anywhere.api is defined in an external resource that is included earlier in the main document using: <script type="text/javascript" async="" src="https://si1.twimg.com/a/1306171173/javascripts/api.bundle.js"></script> Since the script tag has the async attribute, it can load after initAPI() executes. Sounds like a race condition.
Sounds like we should evangelize them to not use async and rely on script ordering!
I've evang'ed; they already knew about this, and have a fix on the way.
(In reply to comment #5) > I've evang'ed; they already knew about this, and have a fix on the way. That's great! Do you have any sense of timeframe so we know when to verify the fix?
I'll ask.
They don't even include the referenced script anymore and it appears they're using async more carefully.