When
website designers write the code for websites, there are two computer languages that they use most often—HTML for setting up most of the text sections, and JavaScript for creating “dynamic content” that changes each time the site is visited, such as a message box popping up. More recently, a new multi-browser JavaScript library—one that consists of pre-written script in that language—has been created to make it easier to perform client-side scripting in HTML. That library is called jQuery. It has only been around since 2006, when it was created by computer programmer John Resig, but already more than half of the 10,000 most commonly visited sites use it.
Activities simplified through the use of jQuery
• jQuery makes it simpler and easier to do a number of things with a website, among them:
• Navigating through the documents
• Handling events—things occurring in an application for which the user has to add a log entry
• Making animations
• Writing applications in AJAX, a technique designed to make websites seem to react more quickly
• Choosing elements from DOM (Document Object Model)—a “cross-platform” convention used to modify HTML pages
How widely used is jQuery?
Different programmers have varying attitudes towards jQuery. The following information was taken from a study conducted by about.com in 2010.
Some users find the language overwhelming to learn because there is so much to it. Those who already have a grasp of HTML or CSS (Cascading Style Sheets) or both find that they are already ahead of the game when it comes to mastering the basics of jQuery. Certainly the language has a very strong “developer base” and is one of the most widely used computer languages today. One of the persons interviewed said that jQuery “really is ‘JavaScript for Web Designers’ because it gives you the functionality-enhancement of JavaScript without the learning curve.”
Some of the basics of the language
jQuery is structurally similar to HTML in that both make use of tags typed between arrow symbols (<>) that enclose the text, with the closing tag being preceded by a slash symbol (/). In addition, jQuery makes use of CSS selectors, each of which begins with a dollar sign. Such tags include html, head, title, body, ol for ordered list, ul for unordered list and so on. Fewer characters and words are needed than for JavaScript. For instance, where in the latter language the body of the classic “Hello world” program would have to be “document.getElementById("divTest2").innerHTML = "Hello, world!"”, in jQuery it would be simply “$("#divTest1").text("Hello, world!").” The programmer in jQuery can also create his own functions, defining them according to pre-existing language processes.
Two other processes that are made easier by jQuery are elements that fade into and out of view—this process uses the fadeIn, fadeOut and fadeToggle functions—and sliding, whereby an images is toggled across the screen.
jQuery plugins
As with all computer systems, jQuery plugins are continually created and updated. They enable the user to perform a variety of tasks. BlogSlideShow is one made for using slides to enhance blog sites, while jQuery Gallery is for scanning image folders and using the findings to create image galleries.
Conclusion
People who have mastered jQuery are in high demand today. They are valuable because they can write web pages quickly and efficiently, thus saving their employers large amounts of money. jQuery will continue to be developed in sync with the Web.