Hi,

I have a serious problem. I am using two jquery code one is for slider and one is for menu.
Know when i put menu script on a page slider disappear. menu start working and also showing drop down menu.
but when i remove Menu jquery script from the page slider start working but menu didn't work.

Menu Script files:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> (When i remove this script slider work otherwise won't work if this script is there)
<script type="text/javascript" src="script.js"></script>

Slider script file:

<script type='text/javascript' src='js/jquery.flexslider.js'></script>

How can i solve this problem.
Slider Link :
Menu link that i want to work on that website:

Dani AI

Generated

Likely cause and quick diagnosis
The slider stops when you add the menu script because a JavaScript error or a second jQuery instance is preventing the rest of the scripts from running. As pointed out, a script tag that’s pointing at the wrong file type will abort execution; another frequent cause is loading a second jQuery after the slider plugin has already attached to the first one (so the plugin ends up attached to a different jQuery object).

How to pinpoint the problem
Open the browser DevTools (F12) and check Console and Network. Look for errors such as “Uncaught TypeError: $(...).flexslider is not a function” (plugin not loaded or $ isn’t jQuery), “Uncaught ReferenceError: jQuery is not defined” (core missing), or “Unexpected token <” (HTML returned for a script). The Network tab shows 404s and the exact script load order — that will tell you whether a plugin loaded before the core or a file path is wrong.

Practical fixes and a safe pattern

  1. Use a single jQuery core if possible: load it first, then all plugins (flexslider, menu plugin), then any initialization scripts. 2) Fix any script src that points to non-.js files or incorrect paths (this is fatal). 3) If you truly must keep two jQuery versions, capture one with noConflict and only use it where necessary, but prefer unifying versions to reduce complexity. 4) Wrap module initialization so $ is guaranteed to be jQuery, for example:
(function($){
  $(function(){
    // initialize slider/menu safely using $
  });
})(jQuery);

Action checklist for

  • Run DevTools, paste the exact console errors if unsure.
  • Fix any .html/.wrong-path script includes.
  • Remove duplicate jQuery includes or standardize to one compatible version.
  • Ensure plugin files load after the core.

Credit to for the debugger advice and to for the noConflict direction — both are useful once you know the exact console errors.

Recommended Answers

All 2 Replies

Your code has quite a few errors which are probably contributing to the problem. The first one I'd fix is:

<script type='text/javascript' src='js/jquery-migrate.min.html'></script>

which is calling an HTML file as JavaScript. That alone could cause everything else to halt. You should also run both the HTML and CSS through a validator to clean them up.

It's a good idea to learn how to use a debugger. Some browsers have them built in (like Internet Explorer) and others use a plug-in like Web Developer Tools for Firefox and Chrome. The debugger will tell you where problems occurred and will often lead to a solution.

<script>var $j = jQuery.noConflict(true);</script>

Use the above code either for Menu or for slider and replace all the $ with $j i.e
$('#selector').function(); replace with
$j('#selector').function();

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.