Ashish Sharma
Ashish Sharma

Reputation: 81

Magento: simple jQuery issue

I have a magento theme that makes use of jQuery and it runs without any issues. The problem arises when i try to add some more jQuery files to be used by my custom html code that i have added on every page.

I added my jQuery files in the head.phtml (Located at: app/design/frontend/default/MY_THEME/template/page/html/head.phtml)

THIS IS THE ADDITON I MADE TO MY head.phtml FILE (using the method suggested here):

<!-- adding jQuery -->
<script type="text/javascript" src="http://www.boozzr.com/jq/jquery.cookie.js"></script>
<script type="text/javascript" src="http://www.boozzr.com/jq/jquery.cycle.all.latest.js"></script>
<script type="text/javascript" src="http://www.boozzr.com/jq/jquery.min.js"></script>
<script type="text/javascript">
//<![CDATA[
     var $j = jQuery.noConflict();
//]]>
    </script>

<!-- ************* -->

The jQuery files that I am trying to use are:

  1. jquery.cookie.js
  2. jquery.cycle.all.latest.js
  3. jquery.min.js

Now, I get following errors in my chrome console:

ON THE OTHER HAND:

Here is an example of jquery file that is being used by my theme and it runs without any problem.

Upvotes: 1

Views: 2883

Answers (1)

jamapag
jamapag

Reputation: 9318

You should import scripts which make use of jQuery after importing jQuery script.

<script type="text/javascript" src="http://www.boozzr.com/jq/jquery.min.js"></script>
<script type="text/javascript" src="http://www.boozzr.com/jq/jquery.cookie.js"></script>
<script type="text/javascript" src="http://www.boozzr.com/jq/jquery.cycle.all.latest.js"></script>

Upvotes: 2

Related Questions