Reputation: 81
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:
Now, I get following errors in my chrome console:
Uncaught ReferenceError: jQuery is not defined
for
jquery.cookie.js
, line 72.
Uncaught ReferenceError: jQuery is not defined
for
jquery.cycle.all.latest.js
,line 10.
Uncaught TypeError: Property '$s' of object [object Window] is not a
function
for this line : $s(document).ready(function(){....}
in
my custom html code that i am trying to include on every page.
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
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