Disable Chrome Developer Tools' $ function
Chrome Developer Tools define a convenient $
function (as well as a few other conveniences). When using jQuery, however, it is convenient to have $ = jQuery
. Is it possible to disable Chrome's autodef开发者_如何学编程ined $
function without disabling the more convenient definitions (like $0
)?
Chrome's autodefined $
is supplanted by any function that may be on the page. Open a console on StackOverflow, for instance, and type $ === jQuery
and you should get true
. Unless I've misunderstood you, there is no need to disable Chrome's default $
to make room for other functions.
Your looking for jQuery.noConflict(). See here:
http://api.jquery.com/jQuery.noConflict/
精彩评论