I'd like to execute my JS after the DOM ready using RequiredJS instead of this:
$(window).load()
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI'd like to execute my JS after the DOM ready using RequiredJS instead of this:
$(window).load()
You can use this feature of the RequiredJS 'domReady!' like the native Magento's modules use:
PHTML
<script>
require(['jquery','domReady!'], function ($) {
// Your Code
});
</script>
Or JS
define(['jquery','domReady!'], function($) {
// Your Code
}(jQuery)
);