PDA

View Full Version : Difference between onDocumentReady() and onReady()



ashu2289
18 Jun 2012, 3:38 AM
Ext provides us two methods onDocumentReady() and onReady(). I did not get any basic difference them.
Please elaborate.

scottmartin
18 Jun 2012, 9:11 AM
The difference is .. there is less typing using onReady() ... it is just shorthand alias.

Scott.

mrprabu
6 Feb 2014, 6:17 PM
Thanks Scott :)..

skirtle
6 Feb 2014, 7:18 PM
As I understand it onDocumentReady is the ExtJS wrapper for DOMContentLoaded, whereas onReady also waits for the framework to be fully prepped and all classes to finish loading.

You'd very rarely need onDocumentReady. Either use onReady or a launch method if you're MVCing.

mdnaveed42
6 Feb 2014, 11:14 PM
Hi,

onDocumentReady: Adds a listener to be notified when the document is ready (before onload and before images are loaded).


onReady: Adds a function to be called when the DOM is ready, and all required classes have been loaded.

and other points as mentioned by Skirtle

Thanks,
Md Naveed
\m/