-1

I wanna use some jQuery to make a sticky nav bar but I get the errors

ERROR: ‘$’ is not defined. [no-undef].
ERROR: ‘document ’ is not defined. [no-undef]

and the code doesn’t work. Can anybody help me why I get these errors and how to solve it?

NightOwl888
  • 55,572
  • 24
  • 139
  • 212
Jafar
  • 13
  • 1
  • 3

3 Answers3

1

I think your Jquery library is not loaded in Page otherwise your script loaded before Jquery.

So, Insert Jquery Library and your custom script like below.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="custom.js"></script>
Pravin Vavadiya
  • 3,195
  • 1
  • 17
  • 34
0

You must include jquery library in the web and before your script.

neattom
  • 364
  • 2
  • 7
0

1st one: Your jquery file is not being properly loaded into your page

2nd: You have a botched version of jQuery. This could happen because someone edited the core file, or a plugin may have overwritten the $ variable.