Webdesign studio WebStudio2U Authorization Write a letter Sitemap

Web development. jQuery in web applications

jQuery in web development Web technologies are constantly developing, therefore the functionality of web pages increases and approaches to the functionality of full-fledged application software. This increasing functionality is implemented with the help of JavaScript. It is not necessary to write codes responsible for all required effects yourself, if there are tens and even hundreds of ready-made libraries that allow to implement these effects. And among the great number of these libraries jQuery library is rightfully considered the most convenient and accessible one.

What is jQuery in web applications?

Let us try to figure it out. jQuery is a JavaScript library that focuses on the interaction between JavaScript and HTML. It was released at BarCamp IT conference in New-York by John Resig in January 2006. What is the main advantage of jQuery? It is laid on the core level – jQuery allows to select DOM (Document Object Model) elements. Besides, thanks to the availability of plug-ins the basic functional of jQuary can be extended.

How to start working with jQuery?

To start working with jQwery you should first of all download this library from any available source. Then your have to initialize it. How to do this? Everything is very simple – you should add the following extract of the program code into the head of the HTML document:

What are the main features of jQuery?

Basic functional of jQuery contains the following features that become available after the initialization:

  • core functions;
  • selectors;
  • attributes;
  • DOM traversal and modification;
  • elements manipulation;
  • CSS manipulation;
  • events;
  • visual effects and animations;
  • Ajax;
  • utilities.

To manipulate necessary elements of a page in JavaScript there are several ways to find them on the page among the rest of the objects. These ways require that you memorize a great amount of information, whereas to find an element with the help of jQuery all you should remember is the ID of the element you want to work with. In this case the code will have the following syntax: $('path to the element(elements)'). The key function in jQuery is $() – this function is used by all jQuery methods.

Who uses jQuery?

Scott Guthrie, the vice president in the Microsoft Developer Division, claims that the jQuery library will become the basis for ASP.Net Ajax Control Toolkit and will be delivered as a part of Visual Studio. John Resig, lead developer of the jQuery library, has announced that Nokia already uses jQuery as a part of its Runtime Web development platform based on WebKit.

What are the advantages of jQuery?

Thanks to the fact that the amount of the jQuery program code is less than the amount of standard JavaScript code it takes less time to develop the elements of a web page. The program code is more understandable as compared to JavaScript. Let us give an example. There is a certain table. Odd lines of the table are painted in the color that differs from the main color. Let us assume, that there is a certain cascading style sheet (CSS) which defines the class (in the example - “odd”) for such style. To implement such effect you need to assign this class to the odd pages. If you use pure JavaScript, the program code will look the following way:

If you use jQuery, the code will look the following way:

$("tr:nth-child(odd)").addClass("odd");

This example shows that using jQuery for implementation of this effect is a more appropriate solution than using JavaScript. A big number of plug-ins allow to produce practically any element or action. To create a simple Ajax query you will need about 5 lines of code, that simplifies the use of this technology to a considerable degree.

jQuery

Theory is nothing without practice. jQuery code would remain just a code if it weren't used by web application developers. Nice pop-up menus, animated graphics, smooth transitions, tooltips and many other design elements can be made using jQuery. There is no doubt that you can get the above-mentioned effects simply using JavaScript without the jQuery library. However, it is the use of jQuery that makes the program code more flexible, understandable, readable and considerably reduces time costs for web application development.

Download the jQuery library

TAGS
jquery, web development, website development, jquery methods, download jquery, jquery library, use of jquery