jQuery wwwhat?

jQuery wwwhat?

jQuery is just a library of powerful JavaScript code,

which helps developers implement dynamic functionality for web pages.

jQuery helps us find HTML (Hyper Text Markup Language) tags in HTML files,

so that we can change the appearance of the content (text/media) using CSS (Cascading Style Sheets).

How to install jQuery

It is very easy to start using jQuery.

Simply go to the Google code depository at:

http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.js

and download version jquery-1.3.2.js.

You may see newer versions of jQuery at the official jQuery site:

http://www.jquery.com

However, the majority of the examples presented in this blog use version 1.3.2.

If a newer version of jQuery is used as an example on my blog,

I will explicitly state the version we will be using.

Next we need to place the .js (JavaScript) file within the root folder of the website.

If you don’t understand what a root folder is,

you need to review beginning literature related to HTML.

We must place a <script> tag in the <head> tag of any .HTML file that will use jQuery functionality.

EX.

<head>

<script src=”jquery-1[1].3.2.js” type=”text/javascript”></script>

</head>

Please be aware that your <head> tag will probably have more than just the <script> tag.

For most of the examples, we will insert the following three HTML tags into the <head> tag.

EX.

<head>

<link rel=”stylesheet” href=”style.css” type=”text/css” />

<script src=”jquery-1.3.2.js” type=”text/javascript”></script>

<script src=”sources.js” type=”text/javascript”></script>

</head>

The first line links to an external stylesheet.

Stylesheets control the appearance of the content contained within HTML files.

If you don’t understand what a stylesheet is,

you need to review beginning literature related to CSS.

The second line links to the jQuery library.

The third line links to the JavaScript file that contains references to the jQuery library.

This may seem confusing, but let’s think about what we’re doing in a different context.

If you need to write a research paper about a specific topic,

you find a library that contains the literature you need.

However, you don’t need all of the information that the library has to offer.

You only need the information that is relevant for the research paper you’re writing.

When you turn in your research paper, your professor will want to see the references for your research paper.

The professor will want to know which books you reviewed to compose the research paper.

jQuery is the library, and ‘sources.js’ contains references to the specific parts of the jQuery library.

jQuery is powerful because it has a wide assortment of tools at your disposal,

however it is unlikely that you will use every tool for every HTML file.

jQuery is a tool box and you will use some of the tools to accomplish an objective.

It’s unlikely that you will use every tool in your tool box every time you want to accomplish an objective.

I want to make this concept easy to understand, so I named the JavaScript file that contains the references ‘sources.js’.

You can name the JavaScript file, that contains jQuery references, anything you want.

However, the title of the JavaScript reference file should help you understand the functionality of the HTML file.

When you work on multiple projects it will get confusing.

Don’t make things hard by using weird or random names/titles in your code.

Your names/titles should be relevant.

We could segue-way into professional coding practices and naming conventions, however that is beyond the scope of this document.

For now, just remember this, naming conventions are important and professional coding practices make things easier.

On large scale projects you might be working with a team of developers.

You need consistency, because each developer will write a portion of the code.

The developers can’t communicate efficiently if they’re calling something several different names,

when one standardized name will suffice.