What is the difference between dojo.ready and jQuery $ (document) .ready

With my limited knowledge, I thought that both dojo dojo.ready and jQuery $(document).ready equivalent to each other. However, I just ran into a problem with my application when everything worked fine for all browsers except some versions of IE in a function called using dojo.ready . I just replaced it with $(document).ready and it works in all browsers. I was happy to make it work, but was not sure why it worked.

I did some basic searching to find the difference between the two, but did not find anything significant.

+4
source share
2 answers

Besides the differences in how they determine if the document is ready. It is worth noting that dojo / ready integrates with other dojo infrastructure, such as the AMD parser and loader, so that it can start after all the necessary widgets have been analyzed, modules loaded, etc.

Dojo <1.7

dojo.ready waits for dojo.require calls and a parser if parseOnLoad is true in your dojoConfig.

Dojo> = 1.7

dojo / is ready to wait for AMD, and additional features can be queued. I believe the dojo / parser request will make it queue for a parsing operation.

dojo / domReady! The AMD plugin provides a simple DOMContentLoaded function class, equivalent to jQuery (document) .ready

+1
source

Here are some tests of ready-made implementations and differences between JavaScript abstractions to handle issues with multiple browsers:

0
source

Source: https://habr.com/ru/post/1399080/


All Articles