我在我的網站上運行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文件如下: