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 -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -