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

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -