When a browser parses a traditional script tag, it must wait for the script to download, parse, and execute before rendering any HTML that comes after it. With an asynchronous script, however, the browser can continue parsing and rendering HTML that comes after the async script, without waiting for that script to complete. When a script is loaded asynchronously, it is fetched as soon as possible, but its execution is deferred until the browser's UI thread is not busy doing something else, such as rendering the web page.
SJ Twitter does at times, block / delay a site's page load.
The fix is this:
Use a script DOM element
Using a script DOM element maximizes asynchronous loading across current browsers:
<script>
var node = document.createElement('script');
node.type = 'text/javascript';
node.async = true;
node.src = 'example.js';
// Now insert the node into the DOM, perhaps using insertBefore()
</script>
Using a script DOM element with an async attribute allows for asynchronous loading in Internet Explorer, Firefox, Chrome, and Safari. By contrast, at the time of this writing, an HTML <script> tag with an async attribute will only load asynchronously in Firefox 3.6 and Chrome 8, as other browsers do not yet support this mechanism for asynchronous loading.
Just a suggestion to fix a problem with both the facebook and twitter modules and increase pageload times.
Also, CSS @import allows stylesheets to import other stylesheets. When CSS @import is used from an external stylesheet, the browser is unable to download the stylesheets in parallel, which adds additional round-trip times to the overall page load. For instance, if first.css contains the following content:
@import url("second.css")
The browser must download, parse, and execute first.css before it is able to discover that it needs to download second.css.
You should use:
<link rel="stylesheet" href="first.css" />
<link rel="stylesheet" href="second.css" />
instead.
Walter.