[Users] onload ="init();" or ext.onReady(function()...)

Tim Heuer HeuerT at landcareresearch.co.nz
Sun Feb 6 23:57:02 CET 2011


Hi Robert,

I would use
Ext.onReady(function(){…});

because it is a cross-browser event handling function and should work in all browsers as expected. Also, this way your programming logic code is separated from the HTML of the page and makes for a cleaner solution. If you are using a cross-browser library anyway using the library’s method would be my general suggestion.

Cheers,
Tim

From: users-bounces at geoext.org [mailto:users-bounces at geoext.org] On Behalf Of Robert Buckley
Sent: Saturday, 5 February 2011 5:02 a.m.
To: users at geoext.org
Subject: [Users] onload ="init();" or ext.onReady(function()...)

Hi,

When developing a relatively large ext/geoext app, which would be the best way of starting the app from the initial html page? I am rather confused about which does what and which is better for performance.

As far as I can understand the following happens..

onload="init();" triggers the javascript code when the html page is fully loaded into the browser


Ext.onReady(function()...loads when the ext.js library has been loaded into the browser (..cache?)
so which is more effective?

yours,

Robert



________________________________
Please consider the environment before printing this email
Warning: This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not read, use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails.
The views expressed in this email may not be those of Landcare Research New Zealand Limited. http://www.landcareresearch.co.nz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110207/30bc0fda/attachment.htm 


More information about the Users mailing list