Recently, I came across some JQuery code with a variable declaration having a $ sign before the variable name.
Below is an excerpt of the code.
var markup = "<p>" + category.description + "</p><ul data-role='listview' data-inset='true'>",
$header = $page.children( ":jqmData(role=header)" ),
markup += "</ul>";
After doing a brief search I found the following explanation very useful and this might take out the confusion that may have you screaming to yourself “Is JQuery now running PHP?”
“ It just seems to be common practice by a lot of jQuery people smarter than us to signify it’s a jQuery object stored in that variable, it has zero to do with jQuery itself per se”.
- Build a Simple Phone Verification with Twilio, PHP, MySQL, and jQuery (twilio.com)
- Decoding jQuery – Callbacks Object (blog.highub.com)
- QuickValidate: Building a jQuery Validation Plugin (onextrapixel.com)
- Reducing bad signup emails with mailcheck.js (andrewberls.com)