我在我的网站上运行Magento 1.7,并试图将JS文件移动到我的页面底部。我跟着一个指南,让我加入到我的布局文件:移动JS文件之前</body>标签Magento
<reference name="before_body_end">
<block type="page/html_head" name="foot" as="foot" after="-" template="page/html/foot.phtml">
<action method="addJs"><script>lib/injectIn.js</script></action>
</block>
</reference>
这下面移动我的网页的所有主要内容的JS文件,但还是有一些其他的东西比它低。我想知道是否有办法将JS文件移动到关闭</body>
标记之前。
例如,我在我的布局文件块像这样,增加了以下我感动的JS文件块的东西:
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
<block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
</block>
下面是一些在Chrome的源代码,这是一个图片你可以看到放一些东西的JS文件如下: