Reputation: 371
I am using JQuery code in my HTML page with help of CDN but I can't test it without internet connection. I am just developing.
How to enable Jquery code locally apart from Google's CDN
Upvotes: 0
Views: 519
Reputation: 1554
Just perform following steps:
Write <script>
tag following way.
<script type ="text/javascript" src="Jquery/jquery.min.js"></script>
Upvotes: 0
Reputation: 29683
Download js
file save it in local and then you can use native fallback to local version if your cdn
fails to load.
Ex
<script src="//ajax.aspnetcdn.com/ajax/jquery/jquery-2.0.0.min.js"></script>
<script>window.jQuery || document.write('<script src="localpathhere/jquery-2.0.0.min.js">\x3C/script>')</script>
<!--The second line of code checks whether jquery has been loaded correctly else it will
write a new script where local file gets referred-->
Upvotes: 4
Reputation: 871
You will need an internet connection to download the jQuery file once. http://jquery.com/download/
Then just include the a path to the local jquery.js file in your html. E.g. if you have your file in a folder Content, it will look like this.
<script src="/Content/jquery.min.js"></script>
Upvotes: 0
Reputation: 4360
For testing in local environments, download the JS file and place in your local computer and reference to it.
Sample:
<script type="text/javascript" src="PATH_TO_YOUR_JS_FILE.JS"></script>
Upvotes: 0