On 04/10/10 03:59, Walter Bright wrote:
Lionello Lunesu wrote:
The new page loads terribly slow because of some embedded resource
from twitter.com. Twitter is blocked in China, so when I open your
website nothing is shown until the connection to twitter times out.
Perhaps you can use XmlHttpRequest in javascript to load the twitter
stuff on the 'background'?

The previous page had the same javascript in it. I don't know how this
one could load slow and the previous one not.

Can you post a diff for how to change the html to load in the background?

Rather than getting the JS to load it in the background, the lazy option is to move the two <script> tags to the bottom of the html before </body> rather than before </head>. Browsers will block rendering of the page if it encounters a script tag until the script has been loaded - by placing them at the end the page will be rendered, followed by loading the scripts.

Alternatively you could use the HTML5 attributes with the script tag to make the scripts load in the background regardless, I don't know what browser support is like for this though.

--
Robert
http://octarineparrot.com/

Reply via email to