views:

68

answers:

2

Hello,

I know there exists a command like jQuery.noConflict. But for this it first registers $, then un-registers it afaik.

I want to edit the jQuery 1.3.2 code to stop it from registering the $ in the first place. I know its not the best of ideas, but I need this in a particular project. Am just not sure how it can be done? I mean what part of jquery.js should I edit/remove? Also, how can I rename jQuery to say jQ from the start itself?

Thank you for your time. Would like any pointers.

I think I need to delete the following from the jQuery code (for 1.4.2):

// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
+3  A: 

noConflict replaces $ with the original object, so it doesn't matter that it registers it first.

If you still want to use $ for jQuery at the same time (so you don't have to write out the long jQuery), you can do this:

$.noConflict();
jQuery(document).ready(function($) {
  // Code that uses jQuery's $ can follow here.
});
jtbandes
It does matter if he already has an accessor for `$` lacking a setter.
Eli Grey
this is really not the answer i am looking for. i just edited the default jquery code.
Alec Smart
A: 

I add jQuery.noConflict() to the bottom of my jQuery file. That's usually good enough.

psayre23