How about a proxy (aka mediator, aka facade ) pattern ?
Let us call that "facade" : jQLint. An facade to the real jQuery
behind . Let's call its instance: $$
// inside jQlint
(function ( window, undefined ) {
// Define a local copy of jQLint
var jQLint = function( selector, context ) {
//
// A lot of sanity testing of the selector+ context
// A lot of warning, messages to the console
// At last pass the action to the jQuery
return jQuery ( selector, context );
},
_jQLint = window.jQLint,
// Map over the $ in case of overwrite
_$$ = window.$$,
// implementation proceeds here ...
Usage :
<script src="jquery.1.4.min.js" ></script>
<script src="jquery.1.4.lint.js" ></script>
<script>
$$("*") ; // using jQueryLINT ... leaves a lot of messages in the
console or wherever , etc ...
// $("*") // back to jQuery silence
</script>
One can switch back and forth obviously ... jQuery stays unharmed ...
And two developments go happily in parallel.
PS: this is an "sketch", not a real and ideal code ...
--DBJ
--
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en.