LearnBoost/socket.io-client — pull request #530 by gabmontes (2013-03-21 21:17:20+00:00)
Title: Inserting callback in DOM before inserting script in JSONP handshake.

There are some old clients that, like the BlackBerry OS 5 browser, that synchronously handle the request, insertion and execution of 'script' tags into the DOM. This behavior breaks the JSONP handshake because the 'script' tag is requested, inserted into the DOM and executed before the callback is set. In current implementations, this is done asynchronously and the callback is set before the JSONP request returns, so it works fine.

In this proposed change, the callback is first set and then the JSONP call is made, ensuring the callback exists even for weird/old browser implementations with no expected changes in actual performance.