2

I am trying to add Java script to a specific CMS page to be loaded in the <head> area. The scripts fails to load.

name.min-1.0.js and name.Mode.js are placed in {magentoroot}/js.

The following is placed in a specific CMS page, under Layout Update XML area. I do flush the Magento cache after save also!

<reference name="head">
<action method="addJs"><script>name.min-1.0.js</script></action>
<action method="addJs"><script>name.mode.js</script></action>
</reference>

enter image description here

What am I doing wrong? Is this conflicting with another script? How can this be fixed?

  • Can u please give me screen shot of Layout Update XML? – Amit Bera Apr 30 '16 at 18:08
  • Just added the screen shot to the questions. – user2774042 Apr 30 '16 at 18:21
  • Have you checked if the path is exactly right? If you are hosting on Linux Magento will not find the file if the real path is myfolder/name.min-1.0.js instead of MyFolder/Name.min-1.0.js. – Andreas Koch Apr 30 '16 at 19:43
  • Yes I have checked that. It is not a case issue. It will not load up even when I have it directly under MyDomain.com/js/Name.Mode.js or mydomain.com/js/name.mode.js. It does not show up in the View Page Source! Should this be placed under skin/frontend/theme/default/js/? – user2774042 Apr 30 '16 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.