javascript - jQuery: How can I use "$" instead of "jQuery"? -



javascript - jQuery: How can I use "$" instead of "jQuery"? -

i have simple jquery in site, yet maintain getting error:

uncaught typeerror: property '$' of object [object domwindow] not function

the error appears if utilize "$" instead of "jquery".

// works jquery(document).ready(function() { jquery('#pass').keyup( ... ); }); // doesn't $(document).ready(function() { $('#pass').keyup( ... ); });

do need utilize "$"?

you can wrap code:

(function($) { // here $ point jquery object $(document).ready(function() { $('#pass').keyup( ... ); }); })(jquery);

javascript jquery

Comments

Popular posts from this blog

.net - Transaction locking an Insert statement -

clojure - Best way to lazily collapse multiple contiguous items of a sequence into a single item -

remove Repeat values from a list in haskell -