- This topic is empty.
-
AuthorPosts
-
May 4, 2014 at 2:18 am #9717sc123Participant
it appears that if you locate your jquery.js files under the same folder or in some subfolders where your html file is, the Firebug problem is solved. eg if your html is under C:/folder1/, then your js files should be somewhere under C:/folder1/ (or C:/folder1/folder2 etc) as well and addressed accordingly in the html doc. hope this helps.
July 18, 2014 at 10:46 am #9711asifaftab87Participantu just add at starting of your page
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
and check your src link in a any browser address bar, if you are getting some code then this will work for you.
asifOctober 30, 2014 at 11:20 am #9718amelianParticipantI have the same issue and no case resolve me the problem. The only thing that works for me, it’s put on the of the Site.master file, the next:
<script src="<%= ResolveUrl("~/Scripts/jquery-1.7.1.min.js") %>" type="text/javascript"></script> <script src="<%= ResolveUrl("~/Scripts/bootstrap/js/bootstrap.min.js") %>" type="text/javascript"></script>
With src=”<%= ResolveUrl(“”)… the load of jQuery in the Content Pages is correct.
December 17, 2014 at 8:41 am #9728develop4lifeParticipant-
Check the exact path of your jquery file is included.
<script src="assets/plugins/jquery/jquery.min.js"></script>
if you add this on bottom of your page , please all call JS function below this declaration.
-
Check using this code test ,
<script type="text/javascript"> /*** * Created by dadenew * Submit email subscription using ajax * Send email address * Send controller * Recive response */ $(document).ready(function() { //you can replace $ with Jquery alert( 'jquery working~!' ); });
Peace!
April 6, 2015 at 1:06 am #9719bhowParticipantI had a very similar issue. In my C# MVC application, JQuery was not being recognized. I needed to move the @Scripts.Render(“~/bundles/jquery”) from the bottom of my _Layout.cshtml file to the head of the section. Also make sure you have grabbed Jquery as a Nuget package if you are using visual studio!
<head> @Scripts.Render("~/bundles/jquery") </head>
April 17, 2015 at 10:57 am #9740naveed-abbasParticipantAs stated above, it happens due to the conflict of $ variable.
I resolved this issue by reserving a secondary variable for jQuery with no conflict.
var $j = jQuery.noConflict();
and then use it anywhere
$j( "div" ).hide();
more details can be found here
May 26, 2015 at 3:41 am #9720patParticipantThere is a way to make it automatically load up javascript before the rest of the code runs.
Go into Views\Shared_Layout.html and add the following
<head> <*@ Omitted code*@> <script src="~/Scripts/jquery-1.10.2.min.js" type="text/javascript"></script> </head>
July 12, 2015 at 1:15 am #9739wolfgang-fahlParticipantmake sure you really load jquery
this is not jquery – it’s the ui!<script language="JavaScript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"> </script>
This is a correct script source for jquery:
<script language="JavaScript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
August 28, 2016 at 7:25 am #9733kyle-mcvayParticipantThat error means that jQuery has not yet loaded on the page. Using
$(document).ready(...)
or any variant thereof will do no good, as$
is the jQuery function.Using
window.onload
should work here. Note that only one function can be assigned towindow.onload
. To avoid losing the original onload logic, you can decorate the original function like so:originalOnload = window.onload; window.onload = function() { if (originalOnload) { originalOnload(); } // YOUR JQUERY };
This will execute the function that was originally assigned to
window.onload
, and then will execute// YOUR JQUERY
.See https://en.wikipedia.org/wiki/Decorator_pattern for more detail about the decorator pattern.
November 28, 2018 at 10:34 am #9721abdulahmad-matinParticipantif
script
tag hasdefer
attribute it show the errorUncaught ReferenceError: $ is not defined
and must remove the attribute
defer
fromscript
tagApril 9, 2020 at 5:32 am #9729anju-battaParticipantThis is the common issue to resolve this you have to check some point
- Include Main Jquery Library
- Check Cross-Browser Issue
- Add Library on TOP of the jquery code
- Check CDNs might be blocked.
Full details are given in this blog click here
June 18, 2020 at 10:18 am #9722david-van-driesscheParticipantSomething that I didn’t find here, but did happen to me. Make sure you don’t have the jQuery slim version included, as that version of the jQuery library doesn’t include the Ajax functionality.
The result is that “$” works, but $.get for example returns an error message stating that that function is undefined.
Solution: include the full version of jQuery instead.
January 25, 2021 at 10:56 am #9736walmacParticipantI had the same problem and resolved it by using
document.addEventListener('DOMContentLoaded', () => { // code here });
March 11, 2021 at 3:09 am #9730adityaubaleParticipantI came across same issue, and it resolved by below steps.
The sequence of the scripts should be as per mentioned below<script src="~/Scripts/jquery-3.3.1.min.js"></script> <script src="~/Scripts/jquery-ui.js"></script> <script src="~/Scripts/bootstrap.min.js"></script>
This sequence was not correct for my code, I corrected this as per the above and it resolved my issue of Jquery not defined.
August 30, 2021 at 1:30 am #9723dwain-bParticipantI was having the same issue and now I have it resolved. My environment is as below;
Laravel with Blade Pages. I had a main layout and used sections to create new pages form my main page layout(template).
I was loading JQuery from my section page and not my main layout. I changed it from the section page to load JQuery from the main layout and also at the top in the head tag.
-
-
AuthorPosts
- You must be logged in to reply to this topic.