/jquery folder is added to the dev’ server samples folder. The work here is intended to replace the older samples in the
/ajax folders. Today, the plan is to use jQuery exclusively. This decision is based on the following:
- My current understanding of the YUI 3.0 Loader shows me not an equivalent of
jQuery.getScript()but far more complex functionality that seems to focus on loading YUI modules more than plain-old
*.jsfiles. This script loading issue is important—this is why projects like Jingo exist.
- The CSS-selector syntax in YUI 3.0 is there but I do not feel the terseness that’s attractive in jQuery. The code samples seem noisy to me. This pressure to rewrite my YUI 2.x code in this “new” style might as well be relieved in jQuery.
Today, my only pressing question about jQuery is about the when to use
jQuery.fn (which is used for plug-ins). Basil Goldman seems to have an explanation in “Defining your own functions in jQuery” but for some reason I’m still not satisfied that I have the best information. Once we start to work with
jQuery.fn we must consider whether we should just build a full-blown plug-in. This implies three issues: extending, adding a new function and building a plug-in. There should be an explanation that coheres all three.
|“jQuery: $.extend() and $.fn.extend() confusion”||“As a general rule, you should extend the jQuery object for functions and the
|“jQuery extend and fn.extend”||“Use the extend function to add a new function to a jQuery object. … Use the fn.extend function to add a new function that will be applied to each element in the set of elements in a jQuery object.”|
|“Learn How To Create Your Own jQuery Plugin”||“The basis of creating a plugin for jQuery is actually quite simple. You don’t have to be a jQuery ninja, nor do you have to sweat blood to make it work. It’s as easy as script writing!”|
|“A Plugin Development Pattern”||“In Mike Alsup’s preamble, I’m inferring that a formal plug-in is needed when your extension depends on one or more ‘private’ functions.”|