Java Reference
In-Depth Information
has a plugin system that makes it easy to build common web page elements, such as a light-
box or carousel widget.
jQuery was released in 2006, originally as a DOM manipulation framework. It has grown
into a bigger framework today that now provides methods for selecting nodes and travers-
ing the DOM, animation effects, Ajax, and events. It also has its own testing framework:
QUnit .
jQuery is a very powerful and polished framework that provides a considerable number
of useful methods. It has become so popular that many online tutorials assume that you're
using jQuery rather than just JavaScript. You can learn more about jQuery by reading the
excellent jQuery: Novice to Ninja: New Kicks and Tricks by Earle Castledine and Craig
Sharkie.
Note: The $ Symbol
The jQuery framework uses the $ symbol as a global namespace object. It
is actually a convenient alias for the the global jQuery object of which all
jQuery's methods are methods. This prevents the global scope from being
polluted with any of jQuery's methods. Other frameworks use the $ sign in
a a similar way since only a single character is needed to access any meth-
ods; however, this can cause method name clashes if more than one of them
are used in the same project.
Advantages and Disadvantages of Frameworks
A big advantage of utilizing a popular library is that it will be used by lots of people and
thoroughly tested. It will probably have been optimized and battle-tested for nearly every
eventuality. Using a framework means that you can be confident that your code will be as
bullet-proof as possible in many browsers. In addition, there will usually be lots of online
documentation and a strong community ready to help out if you become stuck. The pop-
ularity of frameworks often means that others will have encountered the same problem as
you, often making it easy to find a solution by searching on the Internet.
There are some disadvantages to using frameworks, however. You need to include the
code for the framework as well as your own code. This increases the amount of code that
needs to be downloaded by a website, which in some cases can cause performance issues.
Thankfully, most modern frameworks are relatively small once server-side optimizations
Search WWH ::




Custom Search