Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Melonking906 opened this issue Mar 4, 2023 · 2 comments
Open

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

Melonking906 opened this issue Mar 4, 2023 · 2 comments

Comments

@Melonking906
Copy link

Melonking906 commented Mar 4, 2023

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>
@Megas97
Copy link

Megas97 commented Jul 3, 2023

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 <script> tag that utilizes superfish() for a dropdown menu in the 'ready' function. Don't understand what's wrong.

@Megas97
Copy link

Megas97 commented Jul 4, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants