0

I am trying to link a jquery page to my HTML. Is there a way to do this without using a CDN or downloading from the jquery site? I want it to be like linking a standard js file (like below).

<script src="script.js"></script>
3
  • 3
    Host it on your own site? Commented Oct 20, 2021 at 0:37
  • 2
    Download it from the jQuery site. Upload it to your server. reference it Commented Oct 20, 2021 at 0:38
  • What do you mean by "without downloading from the jquery site?" exactly? Commented Oct 20, 2021 at 7:03

1 Answer 1

1

Lets say you want to use the latest version (3.6.0), one way to do this, would be to go to jQuery official site and choose the version you want to use, then copy the src code link, like so:

enter image description here

Navigate to it, copy all the code and paste it into your own js file which you can name whatever way you would like. And then you would be able to link jQuery like so: <script src="MyJquery.js"></script>

In the case of my example I'm using the format min.js , the minified version, so you would need to do it like so: <script src="MyJquery.min.js"></script>

7
  • So by all the code, do you mean the part you highlighted in the screenshot or the entire code in the screenshot?
    – mm4096
    Commented Oct 22, 2021 at 1:36
  • No no. Copy that link of the screenshot, NAVIGATE to that link and then copy all the code in the page of that link, which is the jQuery code you need.
    – Gass
    Commented Oct 22, 2021 at 7:45
  • So I put this in: code.jquery.com/jquey-3.6.0.min.js and it comes up with a 404
    – mm4096
    Commented Oct 22, 2021 at 21:56
  • go to code.jquery.com/jquery-3.6.0.min.js
    – Gass
    Commented Oct 23, 2021 at 5:57
  • So then do I paste the entire code into a js file?
    – mm4096
    Commented Oct 23, 2021 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.