Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery will not load because it can't be found

Tags:

My html page don't works because my script is not loading. The script I'm using is as follows:

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

This is the error:

Failed to load resource: net::ERR_FILE_NOT_FOUND file://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js 

Can you see the problem? I just copied the scripts src from google hosted libraries.

like image 459
user3232772 Avatar asked Mar 26 '14 20:03

user3232772


People also ask

Why my jQuery is not working in HTML?

JQuery is a JavaScript framework and library that adds CSS-like selectors, animations and handy functions to your Web programming arsenal. When jQuery scripts fail to work on your Web server, chances are the jQuery file is missing or you did not include it correctly in your HTML code.

How do I know if jQuery is loaded?

You can just type window. jQuery in Console . If it return a function(e,n) ... Then it is confirmed that the jquery is loaded and working successfully.


2 Answers

I think you're testing this using an HTML file on your local file system. // with no protocol specified is assuming file:// because of this.

like image 143
Tim Goodman Avatar answered Sep 18 '22 20:09

Tim Goodman


You need put http:// before the URL. Try it: http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js

like image 21
MCGBra Avatar answered Sep 21 '22 20:09

MCGBra