-3

I went to the jQuery download page and tried to download the uncompressed version of jQuery, when I left clicked the bottom left download button it seemed to start to download.

Then a dial appeared, which asked for permission to download the file, after accepting, it comes up with the following error:

Error: 'document' is null or is not an object

Code: 800A138F

Origin: Error at the time of running Microsoft JScript

Then tried right clicking the link and using the save as option to save it to the desktop under the filename jquery.js.

However, this failed to load jQuery as well and the same error appears when I try to link it to my website.

This is the filepath I'm using:

C:\Users\Mafe Cardozo\Desktop\jquery.js

And the actual jQuery file that I'm writing the code in to the html file as well is also in the same directory, assuming both links be written in the <head /> element(?)

Community
  • 1
  • 1

3 Answers3

2

Just use the CDN which you link to your html file by this line of html in your head tags.

<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>

This will give you the latest version of the minified jquery. You can choose uncompressed or versions here.

There are many choices for CDNs such as Google. CDNs are from the web and are not local.

Alternatively, download the source here and then save it in the same folder of your html file. This will save the file locally. Then link it like so:

<script src="jquery-file-name"></script>
Andrew Li
  • 55,805
  • 14
  • 125
  • 143
1

If you will have access to the internet when you are needing to use Jquery, then just use a JQuery CDN. That way you don't have to worry about downloading the whole library to your computer and making sure it is in the right spot.

Go to a site like this, click on the "copy" tag on the right, and copy the whole script element. Then paste that into your head/end of your body. For more information, look at the following posts about accessing the Jquery library.

Microsoft CDN for jQuery or Google CDN?

Benefits vs. Pitfalls of hosting jQuery locally

Community
  • 1
  • 1
Chase
  • 137
  • 1
  • 13
1

Just to add to the other answers, you are trying to access the js files with the https protocol, and apparently, it doesn't work. Just remove the https from the url or change it to http (https://code.jquery.com/jquery-2.2.4.js -> http://code.jquery.com/jquery-2.2.4.js) and it should work.

Sebastianb
  • 2,020
  • 22
  • 31