Hey, I was just looking at the docs for the noConflict function and it says nothing about how it works (obviously). I just wondered if anyone knew.
Does it unset $
? (delete window.$
?)
Any suggestions will be much appreciated.
Hey, I was just looking at the docs for the noConflict function and it says nothing about how it works (obviously). I just wondered if anyone knew.
Does it unset $
? (delete window.$
?)
Any suggestions will be much appreciated.
Share Improve this question asked Feb 4, 2011 at 12:04 OlicalOlical 41.4k12 gold badges57 silver badges77 bronze badges2 Answers
Reset to default 10You can check the source code:
// Map over the $ in case of overwrite
_$ = window.$
//....
noConflict: function( deep ) {
window.$ = _$;
if ( deep ) {
window.jQuery = _jQuery;
}
return jQuery;
}
It reverts $
to what it was before jQuery was loaded.