Wednesday 23 May 2012

FAQ's - JQuery


If you put jQuery in your CV, then beware, you should be able to answer following questions. Better you read on, and test yourself how much you can score.

1. What is jQuery & its significance? Why it is so popular?


jQuery is lightweight, client side script JavaScript library file that supports all browsers.JQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery makes it easy to play with the DOM, add effects, and execute Ajax requests.

This helps developer to reduce lines of code while he/she program. For example huge code written in Java Script, can be done easily with JQuery in one or two lines as it uses pre compiled JavaScript library internally. For example To find a Div that have class xxx we can do this using custom JavaScript by looping through all DOM elements, Find Div element write if statement checking the class then write the code to manipulate cross browser.  But this can be achieved using jQuery with 2 lines of code. jQuery is a fun library to use and play.

It is so popular due to the below 10 reasons.
  • Cross Browser Compatibility.
  • Fast but micro Famework.The jQuery core library minified is only about 24KB in size, so it is very easily to include in any application and it is pretty fast as well.
  • Easy to learn and flexible.
  • It is well documented.
  • Reuse of plug-ins across projects .These plug ins are extendable.
  • Latest CSS Complaint.
  • Microsoft, which now includes jQuery with its MVC framework and integrated to VS2010 with intellisense support .
  • IBM, Netflix use jQuery. Nokia have adopted it. Google uses and hosts the jQuery library.
  • Easy to find support since there is a large development community and variety of plug-ins.
  • DOM manipulation with querying and chaining is Wonderful & Robust. It is simple, concise and clear enough.
Hence jQuery is definitely faster, easier and more productive than previous traditional JavaScript that we use, hence its so popular.
Now the Client side development is fun using jQuery Agree or not ??

2. What is jQuery UI?

jQuery UI  is a library which is built on top of JQuery library.  It can be called as one of the JavaScript plug-in that allows to create animations, sortables list, draggle list . This is developed as separate JavaScript File. This can be downloaded from http://ui.jquery.com/download (ui.jQuery.js).
jQuery UI  responsible for widgets,  components , themes , advanced effects , animation  and interaction mechanism that is UI related things.
Accordions, sliders, dialog boxes, date pickers, and more. All these are ready to be used right now.
jQuery UI  can be used to build highly interactive web applications.
You need to include latest jQuery , UI Core and Flora theme style sheet to work with jQuery UI.
In addition to the above source files you may need to refer each of the component files like ui.draggable.js, ui.resizable.js, ui.accordian.js etc .
or  you may will have to refer jquery.ui.all.js script that contains all component .js files . But do not refer all if you are not using . It is advised to refer only the required files. You can also build the custom download .js file by selecting the required widgets .
This is used for Resizing (resizable method is plugged in jQuery UI), Exploding or animations.
The following is an example code that uses  jQuery UI.
Refer the script files.
1."stylesheet" href="themes/flora/flora.all.css" type="text/css" media="screen" title="Flora (Default)"/>
2.
3.
Refer the required Components
1.
2.
3.
1.$(document).ready(function() {
2.$("#dragme").draggable();
3.$("#dragme-x").draggable({ axis: "x" });
4.$("#accordionDemo").accordion({ event: "mouseover" });
5.$("#dragme-resize").draggable().resizable();
6.})
jQuery UI future is hope to be expecting excited and positive.

















No comments:

Post a Comment