本文介绍了如何将 js 文件添加/包含到 Magento 主题中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在修改 Magento 主题.并且想在主题/js文件夹中添加一个js文件.我添加了以下代码:
I am modifying a Magento theme. And want to add a js file into the theme /js folder. I have added the following code:
skin_jsjs/custom-script.js
进入/app/design/frontend/theme-name/default/layout/page.xml并将js文件发布到/skin/frontend/theme-name/default/js/.但没有运气.它没有显示在页面上.
into the /app/design/frontend/theme-name/default/layout/page.xml and published the js file into /skin/frontend/theme-name/default/js/. But no luck. It is not showing on the page.
推荐答案尝试将以下内容添加到您的布局 .xml 文件中
Try adding the following to your layout .xml file within <reference name="head">
<action method="addJs"> <script>js/custom-script.js</script> </action>更多推荐
如何将 js 文件添加/包含到 Magento 主题中
发布评论