I have two scripts, which are included in the HTML body. In the first script I'm initializing a JS-Object which is referenced in the second script tag.
<body>
...
<script type="text/javascript" src="http://url/script.js"></script>
<script type="text/javascript">
obj.a = 1000;
obj.do();
</script>
</body>
What is happening, if loading time of the first script (via HTTP) is slow? How is the execution order of the JS in the body?
asyncproperty.loadlistener for the external script, but it would be a nightmare for cross-browser compatibility. Otherwise,asyncis only useful if the linked script is the primary active script (i.e., not a library) or if the linked script fires a custom event announcing that it is ready, which most libraries don't do.asyncunless I design everything to work that way :)