jQuery Fundamentals

Like most web devs I’ve been using jQuery for some time now – and managed to do some fairly advanced things, without ever really reading up on the framework. If anything this probably speaks for the intuitive syntax and the excellent range of examples available at the main jQuery and jQuery UI sites.
However, this kind of learning does mean that you end up with some potentially embarrassing holes in your basic knowledge and understanding. Like for example a while back when, in a less successful job interview, I was asked what this jQuery code does:

$(function() {});

My immediate answer was “nothing”, which is true enough – but the follow up question from the examiner was then “well, when does this code run?”
Turns out it’s a shorthand for the usual $(document).ready(/*...*/) loader – so the two code examples below are functionally identical:

	$(document).ready(function() {
		alert('Document is ready for ya!');
	});

	$(function() {
		alert('Document is ready for ya!');
	});

So – there’s something you can use to confuse, befuddle and confound your co-workers…
For me, it was a reminder to get back to reading the excellent free jQuery Fundamentals.
Also Using Objects to Organize Your Code has been on my jQuery/javascript reading list for a long time now.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

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

%d bloggers like this: