I tried to add a javascript with a custom template through its page.xml like this:
<action method="addItem"><type>skin_js</type><name>myjs.js#notify</name></action>
Notify will throw an alert windows so I can check if it's correct after reload. In addition I check the source code to see where it tries to go. Template is correctly setup and cache is flushed.
With the above script it goes to:
<script type="text/javascript" src="http://127.0.0.1/magento/skin/frontend/base/default/myjs.js#notify"></script>
Which doesn't exist here.
Script is located in skin/frontend/default/blank2/js/live.js
Try changing (assuming that myjs.js is in skin/frontend/default/blank2/js/myjs.js)
<action method="addItem"><type>skin_js</type><name>myjs.js#notify</name></action>
to
<action method="addItem"><type>skin_js</type><name>js/myjs.js#notify</name></action>
Because myjs.js is not found in your theme then it will try to look for it in the base theme folder
It means that it cannot find the js in your theme nor the default folder.
Change to:
<action method="addItem"><type>skin_js</type><name>js/myjs.js#notify</name></action>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With