RuFFCuT
RuFFCuT

Reputation: 317

One piece of JavaScript breaking another

the website can be found here: http://www.healthygit.com

Basically when the site loads depending on what order I include the javascript depends what breaks, for example:

If I include the Menu JavaScript (below) first then the menu will not work but the image slider will.

Menu JS:

<script type="text/javascript" src="js/jquery.js"></script><!-- jQuery -->
<script type="text/javascript" src="js/jquery.easing.js"></script><!-- jQuery Easing   effects -->
<script type="text/javascript" src="js/megamenu_plugins.js"></script><!-- Mega Menu Plugins (scroller, form, hoverIntent) -->
<script type="text/javascript" src="js/megamenu.js"></script><!-- Mega Menu Script -->

But if I include the menu files last the menu will work and the slider will not, the slider files are:

<script type="text/javascript" src="js/jquery.list-rotator.min.js"></script>
<script type="text/javascript" src="js/preview.js"></script>

The errors I am getting are:

ReferenceError: jQuery is not defined
...),delay:m(a(this).attr("delay"),bE),effect:r[a(this).attr("effect")]!=undefined?...

jquery....min.js (line 1)

And

ReferenceError: $ is not defined

$(document).ready(

preview.js (line 1)

Can anyone help me please?

Upvotes: 0

Views: 269

Answers (1)

nmenego
nmenego

Reputation: 856

I noticed in your webpage that you placed jQuery last. I think it should be at the first. Have you tried it in the following order:

<script type="text/javascript" src="js/jquery.js"></script><!-- jQuery -->

<script type="text/javascript" src="js/jquery.easing.js"></script><!-- jQuery Easing   effects -->
<script type="text/javascript" src="js/megamenu_plugins.js"></script><!-- Mega Menu Plugins (scroller, form, hoverIntent) -->
<script type="text/javascript" src="js/megamenu.js"></script><!-- Mega Menu Script -->

<script type="text/javascript" src="js/jquery.list-rotator.min.js"></script>
<script type="text/javascript" src="js/preview.js"></script>

Tell me if it helps.

Upvotes: 1

Related Questions