superfish icon indicating copy to clipboard operation
superfish copied to clipboard

jQuery(...).superfish is not a function

Open Melonking906 opened this issue 1 year ago • 2 comments

I'm unclear what the cause of this error is - superfish seems to work fine and this error is only present on one particular page, not all pages using the same template.

jQuery.Deferred exception: jQuery(...).superfish is not a function @http://localhost:8888/general-discussion/ddd/:10:26
e@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:30310
Deferred/then/l/</t<@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:30612
setTimeout handler*Deferred/then/l/<@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:30821
c@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:28599
fireWith@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:29344
fire@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:29380
c@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:28599
fireWith@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:29344
ready@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:32317
$@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:32096
EventListener.handleEvent*@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:32465
@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:220
@http://localhost:8888/scripts/jquery-3.6.3/jquery.min.js:2:225
Uncaught TypeError: jQuery(...).superfish is not a function
    <anonymous> http://localhost:8888/general-discussion/ddd/:10
    jQuery 13

HTML head code

<script src="/scripts/jquery-3.6.3/jquery.min.js"></script>
<script type="text/javascript" src="http://localhost:8888/Themes/news/scripts/superfish.min.js"></script>
<script type="text/javascript" src="http://localhost:8888/Themes/news/scripts/hoverIntent.js"></script>
<script type="text/javascript">

		jQuery(document).ready(function() {
			jQuery("ul.dropmenu").superfish();
		});

</script>

Melonking906 avatar Mar 04 '23 15:03 Melonking906

Have the same issue with a SMF theme that loads everything exactly as you've pointed out: first jQuery, then Superfish and then having another

Megas97 avatar Jul 03 '23 21:07 Megas97

The problem for me was that I had included two instances of jQuery on my page where this plugin is also included. One jQuery was included before the plugin initialization and another was included after the plugin initialization. When I moved the superfish plugin include and initialization lines after the second jQuery inclusion line it started working without problems. So you should check the page source of that page that gives you the error and see if you have multiple jQuery instances included on it.

Megas97 avatar Jul 04 '23 22:07 Megas97