Why we have to add jquery.mn.js (some file ) to the SCRIPT tag.., in form validation and some other jquery and ajax programs..
Where we can download that file., and where have to SAVE that file in PC.
Why we have to add jquery.mn.js (some file ) to the SCRIPT tag.., in form validation and some other jquery and ajax programs..
Where we can download that file., and where have to SAVE that file in PC.
jQuery code will not work without the library being referenced on your page (usually in the <head>
tags).
Also, there are some other libraries that build on top of the jQuery library, like Twitter's excellent bootstrap library, or jQueryUI. In those cases, you need both the jQuery library and the additional library -- as shown for jQueryUI in the first example below.
There are a few options for including jQuery libraries on your page.
CDNs (Content Delivery Networks) are online storage locations where web pages can grab the specified code, without you needing to store it on your server. This is why a CDN is a good idea.
One: 1. Use a CDN:
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
</head>
Two: 2. Download the jQuery script:
public_html
), but you can store it anywhere (and name it anything you want -- you just have to use the same name/location when you reference it in your <script>
tag.js
Include it in your head tags, thus:
Three: 3. A combination of the above, with fallback
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script> window.jQuery || document.write('<script src="../js/jquery-1.10.2.min.js"><\/script>')</script>
The above code does this:
a. Load the jQuery library from the CDN
b. IF the CDN did not load, then load the jQuery from the specified location on my server (Note that the jQuery library must also be available on your server, at the location specified).
Notes: