The documentation for the source file is a bit clearer; he says: "This can be disabled or configured by setting io.socket.options during the first cycle of the event loop."
Basically, what happens is that in the library there is a call to setTimeout(fn, 0) , which is idiomatic for starting a parallel process. However, the JS standards explicitly state that JS is single-threaded: in other words, although setTimeout and setInterval asynchronous , they are not actually parallel in the sense that any of their codes will run simultaneously with any other code. Therefore, they wait until the current function ends before they are executed. This queuing mechanism is known as the JavaScript event loop.
I believe that what you asked the script to author was to change the source to include the corresponding change, perhaps at the bottom of the file for your convenience.
It is also likely that a similar effect will be achieved by placing the <script> under the one loading this JS. This was not explicitly standardized by HTML 4, but it can be implicitly standardized in the new HTML 5 specification (this is a complex interaction between the various parts of the specifications).
In terms of HTML5, it looks like current specifications say that there is an afterscriptexecute event and a load event that occur immediately after loading any remote script (or, if it is an inline script, the load event is scheduled as a task - I'm not sure when this will happen). This way you can guarantee this without changing the script, instead:
<script> function do_not_autoload() { } </script> <script onload="do_not_autoload()" src="./path/to/sails.io.js"></script>
but I'm not sure what the compatibility table for script@onload will look like.
I made you a jsfiddle that you can use to capture a βfingerprintβ for different browsers in order to understand what valuation orders are missing there in the wild. * is the document.body.onload event. On my system, it produces:
Firefox 32.0.3 : cafdbe* Chrome 37.0.2062 : cafd*be IE 11.0.9600 : cafd*be
In other words,
CR Drost
source share