Jared 0 Posted March 3, 2012 Report Share Posted March 3, 2012 (edited) Hello All, So you frequently see reductions with commonly used objects such as: var $this = $(this)//Or....var $objectName = $('.className') Is there any places or reason why you would chose to use the $ before the var name to create an object as oppose to just making a normal variable? I'm looking to find and replace the objects with these sorts of variables to reduce file size, make it easier to read, and hopefully speed up load time but to check with experts before I potentially F#$! up my work. Thoughts? Also, any thoughts on how to structure code (in general) to run most efficiently would be helpful. I auditioned a very scant, un-skinned version of my page on the server and it took much longer than I expected to load (on my itty bitty netbook of which I think some cell phones have more processing power). Thanks! Edited March 3, 2012 by Jared Quote Link to post Share on other sites
thescientist 231 Posted March 4, 2012 Report Share Posted March 4, 2012 it has nothing to do with what type of variable it will, that all depends on what is on the right side of the assignment operator. It is most likely a note/indicator/reminder to the author that the variable is a jquery object/variable. Quote Link to post Share on other sites
Jared 0 Posted March 4, 2012 Author Report Share Posted March 4, 2012 Thanks again, Scientist! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.