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 http://learn.jquery.com/about-jquery/how-jquery-works/

# 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 http://api.jquery.com/category/selectors/basic-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. http://doc.jsfiddle.net/tutorial.html

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

Excellent tutorial on JavaScript, especially for function prototypes etc.

http://ejohn.org/apps/learn/

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s