Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

What to do when jquery won't load?

Featured Replies

I've always used

 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

in the head tag of my project and never had any problems but today jquery is somehow not loading. I haven't changed anything in my project and it worked yesterday plus it works when I load a different version. I also double checked that I don't have two versions running. Does this mean this version is unavailable on google?

 

I suppose I could download it but it has always been very reliable.

 

Am I missing something?

Is your page displaying any JavaScript errors?

 

If you're using Chrome, FF or IE, hit F12 to load the corresponding console.

 

Other than that, I'm not sure. I've never come across this issue myself!

Edited by Lyndsey

  • Author

Yeah it basically says that jquery is undefined:



ReferenceError: $ is not defined
[Stopper sur une erreur] 	

$(document).ready(function() {

ReferenceError: jQuery is not defined
[Stopper sur une erreur] 	

...;"></div>').appendTo("body"),e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove...

jquery...v=2.1.4 (ligne 45)

ReferenceError: $ is not defined
[Stopper sur une erreur] 	

$(document).ready(function() {

index.html# (ligne 268)

ReferenceError: $ is not defined
[Stopper sur une erreur] 	

$(document).ready(function() {
  • Author

It works if I get it directly off jquery.com so maybe I'll leave it at that.

<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.1.min.js"></script>

Is the error still there? I've just added that script to one of my own pages and I'm not having any issues.

 

Usually in my experience, the undefined error relates to a jQuery conflict (multiple instances of jQuery) but if you're sure that this isn't the issue then I'm stumped.

OP is using Google's hosted jQuery library, and the use of http: isn't necessary.

 

See here for more information :https://developers.google.com/speed/libraries/devguide#jquery

 

Lyndsey.

 

It's not necessary when you run from a server. But the http: is needed if you test locally. At least for me, i'm on windows

 

OP is using Google's hosted jQuery library, and the use of http: isn't necessary.

 

See here for more information : removed.

 

Lyndsey.

 

My apologies, I'm used to self hosting jQuery

  • Author

Cheers! That was it. I was indeed testing on a local server and I copied/ pasted the code from my last project which I worked on live and on Mac. Many thanks to all of you. Its lovely to come back from lunch and have your problem solved while you were gone. ;)

Edited by mantis

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.