No more initialize call needed for optimizing your page

In a previous post, we’ve seen that calling Sys.Application.notifyScriptLoaded is no longer needed. Another good news is that the Sys.Application.initialize call you could used to force Sys.Application to do its work is no longer needed because the library has changed and now initialization will be done during the DOMContentLoaded event (for standard compat browsers).

For IE, a trick is needed: a dumb element is created and the doScroll method is called successively until it doesn’t throw (throwing means that DOM still hasn’t been loaded). Not pretty, but it works.

Bottom line: MS AJAX has been improved and now the client code will be run as soon as possible (but not sooner than it should).

And that’s it. Stay tuned for more on MS AJAX.

Advertisements

~ by Luis Abreu on October 8, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: