Getting to know jQuery
What is JQuery
What can you do with jQuery?
JQuery has several tools for finding HTML elements. You can select single or multiple elements. An advantage is that jQuery uses CSS selectors.
You can manipulate several parts of a page, create elements and add/remove new classes, IDs, attributes and styles.
You can easily insert existing documents without having to reload the page.
Animating components of a page
With jQuery you can easily create complex animations with simple methods. You can hide or view, fade-in or fade-out, open and close, highlight and move elements. That's a lot of interactive dynamics!
JQuery and its community
JQuery is so popular, because jQuery code is well-structured, clean and simple. JQuerys slogan is: "Write less, do more" - that's exactly what jQuery makes possible. Another Advantage of jQuery is its growing community. New jQuery extensions and snippets are published daily.
There are two versions of jQuery, which you can download from http://www.jquery.com - the minified version and the uncompressed version. It's recommendable to use the minified version, because it's compressed and loads faster. If you later want to look at the original jQuery code to find out how it works, you can use the uncompressed file.
There are different possibilities to include jQuery in your HTML files.
Including the downloaded jQuery file
Using jQuery with a CDN (Content Delivery Network)
In this case you can include jQuery from a host-website. In the following example we use http://code.jquery.com.
You can also use other CDNs, for example Google.
An advantage of CDNs is that you don't have to worry about downloading the newest version. You only have to change the url in your code. A disadvantage is, that you have to rely on third party servers.
Where do we include jQuery?
The best practice is including jQuery in the
Continue to part 2