Javascript runtime error: $ is undefined

I added a script on the Default.aspx page. I get the following error. Error

+6
source share
5 answers

$ defined by jQuery, which you probably did not refer to. An easy way to get this is to add one of the CDN URLs to your HTML template:

 <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> 
+27
source

You need to enable jQuery: http://learn.jquery.com/about-jquery/how-jquery-works/

 <!doctype html> <html> <head> <meta charset="utf-8" /> <title>Demo</title> **<script src="jquery.js"></script>** </head> <body> ... </body> </html> 
+4
source

I had the same issue, but I had the correct jQuery reference.

I solved it by specifying jQuery before any other scripts. In your case, it will look like this:

 <script src= "scripts/jquery-ui.js" /> <script src= "scripts/JavaScript_scroll.js" /> 

Hope this helps someone else with a similar problem.

+3
source

I had the same issue as $ Unidentified. After a long struggle, I found out that there is an HTML code error on the main page, So it worked fine when i include the Jquery files directly in Content page enter image description here

+1
source

(For others who may face the same problem as the OP)
I had the same problem, but the reason is because I tried to load my jQuery script before loading the jQuery library itself. In other words, make sure you add this line first:

 <script src="Scripts/jquery-{version}.min.js"></script> 

before adding

 <script src="Scripts/JavaSript_scroll.js"></script> 
0
source

Source: https://habr.com/ru/post/949398/


All Articles