0
votes

about jQuery

posted November 2, 2008 - 4:01am
about jQuery

http://www.yesave.com/?p=17
When jQuery in January 2006 when coming out to my first impression is that this stuff very smart structure. Based on CSS selector (CSS selectors) to RBI all, the very idea of smart (reference getElementsBySelector). But the chain box fortifications (chaining stuff) looks more like a gimmick, and it seems as a whole, jQuery library to provide the functions and can not cover all the basic things. I therefore conclude that, jQuery be short-lived.

Over the past few months, I gradually understand their own are wrong. From a technical considerations on the process, jQuery sharply. It used simple way to package a large number of commonly used functions, and to provide sophisticated plug-in API, to meet the standard library functions outside the module. jQuery uphold the core, is a collection of DOM elements (Translation: usually some subset) - to its collection as a fundamental element to a high degree of abstraction out. The most important thing is to follow this best practice in the abstract, can jQuery with other JavaScript code get along well.

Many of the jQuery, are directed at the primary designer and developer. Next I would like to explain why jQuery also attract those who experienced developers.

Name space (Namespacing)

The preparation of reusable, good JavaScript code, the key lies in the name of the space to the positive control. JavaScript has only a single, global name space (that is, the window object), and a lot of programmers (and some libraries) to add it to all kinds of arbitrary things. To know that global variable is the devil! The smart developers will use technology similar to the component model to make every effort to reduce the overall number of objects.

jQuery only to the name of the whole space into a tag: jQuery functions / objects. The rest of the jQuery either directly attributes (Translation: the original ‘directy property’ slip of a pen line should be ‘direct property’), or the call to return to the function of the jQuery object.

In regard to upgrade the language, jQuery offers a lot of function (function), but each function has been assigned to the jQuery object attributes: jQuery.each, jQuery.extend, jQuery.grep, jQuery.map, jQuery.merge and jQuery.trim . As a result, they will not conflict with other code.


Website: http://www.yesave.com/?p=17

A Xomba Account Lets You:

Read - Expand your mind. Write - Share your ideas Get Paid - Expand your pocketbook Get Started Today!


Comments

Post new comment

  • Lines and paragraphs break automatically.
  • You can use BBCode tags in the text. URLs will automatically be converted to links.
  • Allowed HTML tags: <p> <br> <b> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <span> <object> <param> <embed> <table> <tr> <td> <div>
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

Join Xomba Today

Do you like to write? Would you like to make a little extra money on the side? These people do. Join the Xomba community today.
Become a Member