making jQuery.noConflict() callable anytime

making jQuery.noConflict() callable anytime

hello,

I use jQuery in an environnement where other js library than jquery are loaded, and the loading order of libraries may be difficult to control properly.
I use a code like this in all my pages (this is autogenerated):

jQuery.noConflict()(function ($) {
...
});

I understand that jQuery.noConflict() should only be callled if jquery is loaded *after* the other library.
I would like noConflict() to be callable anytime. what about this implementation:

    noConflict: function( deep ) {
        if (window.$ === jQuery) window.$ = _$;

        if ( deep && window.jQuery === jQuery) {
            window.jQuery = _jQuery;
        }

        return jQuery;
    },

that is, only return control of $ and jQuery if necessary

what do you think? are there any defiencies in this code that I don't understand?
regards,
jephte clain