jQuery Starter Bits

I’m going to be doing some jQuery work over the next few months so I thought to myself, “why don’t I put my notes and such up on the blog”.  I decided that was a good idea so this is the start of those notes & other such how-to write ups.

The first thing anyone needs to do when starting to use jQuery is to reference the library.  There area  couple different ways to do this, depending on which version you want to use.

Reference Method #1

One of the most common reference methods for jQuery is to reference the latest, greatest, always updated library located at Google hosted or Microsoft hosted CDN.  With this method you just reference the particular version you are using as shown below.

[sourcecode language="html"]
<link rel="stylesheet" type="text/css" href="../../Content/Site.css" /> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"> 
</script>
[/sourcecode]

The Microsoft jQuery CDN can be found here:

[sourcecode language="html"]
<link rel="stylesheet" type="text/css" href="../../Content/Site.css" /> 
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2.min.js"> 
</script>
[/sourcecode]

Reference Method #2

The second method is to download the library from the jQuery.com Website.  Then of course reference it locally to the server you host it on.

[sourcecode language="html"]
<head runat="server">

<link rel="stylesheet" type="text/css" href="../../Content/Site.css" /> 
<script type="text/javascript" src="../../Scripts/jquery-1.4.1.js">
</script>

[/sourcecode]

Some ASP.NET and ASP.NET MVC specific notes.

ASP.NET and ASP.NET MVC comes with version 1.4.1 included in the Scripts Directory of any ASP.NET or ASP.NET MVC Project Application Template you create/start.  This backs the new Microsoft support of the jQuery Library.

Shout it

One thought on “jQuery Starter Bits

Comments are closed.