javascript - Why not always use the "jQuery" function rather than "$" to avoid problems -


i know dollar sign single character type, , "jquery" 6...but doesn't using jquery function prevent sorts of weird problems can occur overloading $ function?

if javascript obfuscated won't matter form used anyway during run-time.

i'm confused why it's not best practice avoid $ (and treat kind of javascript "bad part").

disregard asked question jquery , $. (and i'm pretty sure other developers) count practice define name used external library explicitly.

either using iife, adm loaders (like requirejs) or similar techniques, no matter how have in common content of js file wrapped function body creates scope encapsulating variable , function definitions have there , pass used libraries arguments wrapper function.

3rd party libraries not passed wrapper parameters have count not existing.

so inside of wrapper can use ever name want given libraries (never less should stay common naming used other developers)


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -