What is jQuery?
Jquery basic example:
What is dollar sign($)?
In jQuery, the most powerful character / symbol is the dollar sign. A $() function normally returns a set of objects followed by a chain of operations. An example
1.$("div.test").add("p.quote").html("a little test").fadeOut();
Think of it as a long sentence with punctuations. Indeed it is a chain of instructions to tell the browser to do the following:
1. Get a div with class name is test;
2. Insert a paragraph with class name is quote;
3. Add a little text to the paragraph;
4. Operate on the DIV using a predefined method called fadeout.
The most commonly used command in jQuery is Document.Ready(). It makes sure code is executed only when a page is fully loaded. We often place code blocks inside this Document.Ready() event. For example:
alert("I am ready!");
More example to understand
jQuery has a simple statement that checks the document and waits until it's ready to be manipulated, known as the ready event:
// Your code here
Inside the ready event, add a click handler to the link:
alert("Thanks for visiting!");
Save your HTML file and reload the test page in your browser. Clicking the link on the page should make a browser's alert pop-up, before leaving to go to the main jQuery page.
For click and most other events, you can prevent the default behaviour - here, following the link to jquery.com - by calling event.preventDefault() in the event handler:
alert("As you can see, the link no longer took you to jquery.com");
Where to find more information?
Start out by checking the official site: http://docs.jquery.com/.
Revision number 3, Tuesday, January 05, 2010 4:16:38 AM by xiii
You must Login to comment.
Wed, Jul 27, 2011 7:37 PM
Great jQuery Tutorials
Great jQuery Tutorials jQuery is used on more and more sites. Here are some sites where you can find great tutorial for jQuery: Tutorial Sites http://docs.jquery.com/Tutorialshttp://www.impressivewebs.com/jquery-tutorial-for-beginners/http://www.instantshift
Thu, Oct 7, 2010 8:42 AM
JQuery: A Quick Start Guide
Sat, Feb 27, 2010 4:52 PM
Ext JS - http://www.extjs.com/ jQuery Moo Tools - http://mootools.net/ Prototype - http://www.prototypejs.org/ script.aculo.us - http://script.aculo.us/ YUI - http://developer.yahoo.com/yui/