JQuery is a library API within the javascript language, the API (Application Program Interface) is classes/functions that do all of the work for you and you can access them.

Both google and Microsoft host the JQuery API for you, and all you need to do is to load in the javascript from either or server hosted setup, for google it would be this to get version 1.4.2 of the JQuery language.

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
google.load("jquery", "1.4.2");
-- or one line
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

or with MS you can use

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>

once you have the JQuery API loaded you can then access the HTML document objects by using the $ symbol and act on any part of that document object that supports the functions that you want to do, e.g. a div tag would have different options for styling compared to a span tag.

The API library set is defined abit more in that link, but in whole it is a very effective and usable API library that just makes life more fun :).

For example the code below will output a mini function that will for “each” number in the first parameter (can be anything, object, letters etc) and do the function, will in this case will square the value, but the .each command is very powerful,

$.each([1,2,3], function()
	document.write(this * this);

the reason why it is very powerful is because if you want to select a group of items and then on each of them alter there elements, then you just need to use the JQuery selection process, like so


and this will alter all of the div’s on the web page accordlying. Shall do some more posts on JQuery API once I have a full set of examples to attached to the post.

Leave a Reply

Your email address will not be published. Required fields are marked *