1

When i try to use AngularJs with SemanticUI.js, the console says

Uncaught ReferenceError : jQuery is not defined

Here is my example of implementation :

<html>
<head>
<!-- I'm head of the document -->
</head>
<body>

<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/angular.min.js"></script>
<script src="assets/js/semantic.min.js"></script>

<!-- My own script place right here -->

</body>
</html>

Am i doing the right way? I've tried to swap the script position, but my code still doesn't work.

I think the problem in the semantic.min.js, maybe the $ has been replaced by angular or something that i don't know, because when i try to remove the semantic.min.js, no one appears in the console.

I have also try another solution that i've found in stackoverflow, but yes, it still not works.

Only additional information :

AngularJs version 1.5.5
JQuery version 2.2.4
Semantic version 2.1.8

Can anyone give me a solution?

nmfzone
  • 2,755
  • 1
  • 19
  • 32

3 Answers3

0

I think it's jQuery problem.

That error can only be caused by one of three things:

  1. Your JavaScript file is not being properly loaded into your page
  2. You have a botched version of jQuery. This could happen because someone edited the core file, or a plugin may have overwritten the $ variable.
  3. You have JavaScript running before the page is fully loaded, and as such, before jQuery is fully loaded.

Please take a look in here for more detail.

JQuery - $ is not defined

Community
  • 1
  • 1
Ucay
  • 96
  • 6
0

just add a slash

<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/angular.min.js"></script>
<script src="/assets/js/semantic.min.js"></script>
Saneesh B
  • 572
  • 4
  • 13
0

Oops, sorry, my bad.

I found the problem, it's not the jQuery problem, it's Electron problem.

Because my project use Electron, so the solution is right here :

Electron : jQuery is not defined

Community
  • 1
  • 1
nmfzone
  • 2,755
  • 1
  • 19
  • 32