JavaScript 101

Having programmed for many years, but never in JavaScript, these puzzled me.

$ = just happens to be a valid identifier. Often used to refer to the jquery global object

jQuery =  A really popular framework. More on the basics

# and . = a jquery shortcut on css selectors. # selects HTML elements by ID, while . selects by name. So “#row” selects all elements with ID row, while “.row” selects all elements. More on their CSS selectors

function() = just happens to be a default function name used in jQuery.

btw, single quotes or double ‘ vs ” are both valid. Use whichever suits your style. But be consistent. I use single quotes as it implies a program character, as opposed to content character.

jsfiddle is absolutely amazing.

JavaScript is case sensitive! addEvent and addevent are not the same obviously!

Excellent tutorial on JavaScript, especially for function prototypes etc.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s