0

Magento calls my merged javascript file but also calls other "loose" javascript files. This only happens on the category and productpages.

The extra javascript files have the wrong path, so there are 404 errors. for example: url.com/category/sub-category/js/bieb/jquery.sortportfolio.min.js

See also the magento website: http://ongedierteproducten.nl/boktor/boktor-bestrijdingsmiddelen/embasol-boktor-dood-5-liter-20-m2

How do I solve this? Thanks in advance.

2
  • hey everything looks fine..where is the problem? Commented Apr 11, 2014 at 17:43
  • inspect with firebug or chrome. You will see that many js files get a 404 error on the link I provided. Commented Apr 11, 2014 at 18:29

1 Answer 1

0

You should not using Relative Paths in magento

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>

<script type="text/javascript" src="http://ongedierteproducten.nl/js/slider/jquery.slider.js"></script>
<script type="text/javascript" src="js/bieb/jquery.easing.min.js"></script> 
<script type="text/javascript" src="js/bieb/jquery.quicksand.min.js"></script>
<script type="text/javascript" src="js/bieb/jquery.sortportfolio.min.js"></script>

Instead you should add your javascript using

<reference name="head">
    <action method="addJs"><script>folder/file.js</script></action>
</reference>

See Adding external JavaScript file to Magento

Sign up to request clarification or add additional context in comments.

2 Comments

I checked page.xml the files are coded there as you said. Only I cant find the above files in page.xml or catelog.xml . You maybe know where I can find the js files of my post?
Since it doesn't have a domain name in the url, more than likely it is included in a .phtml file. Check your header.phtml, do a global search for or turn on magento developer tool to see the name of the block/phtml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.