I want to add a js script near the </body>
tag. But, in my project there are more than one layout files having <referenceBlock name="before.body.end">
. So, is there a specific order in which these gets executed. I see several scripts added using this handle. I want to add a script at the end of the body tag i.e., near </body>
tag.
Add a comment
|
1 Answer
Within <sequence>
tad in etc/module.xml:
you can place all the modules, which have the same layout definition, so that your module will be loaded after them.
Better idea is to google the words: "magento2 defer js" and find either free or paid extension, which will move all your scripts to the bottom wherever they are.