I arrived to the interview 20 minutes early like I typically do to show my dedication to not only being on-time, but being prepared and "ahead of the game". As I sat in the reception area grasping my messenger bag filled with a notebook, pen and extra resumes, I began to prepare myself for the imminent barrage of technical questions that were certainly headed my way. My interviewer greeted me and brought me back to his office where he proceeded to grill me on my technical background. Then the question came up. "Tell me about your experience with JavaScript." I hated this question. I've been asked this question probably 2 dozen times in various technical interviews or discussions. "Well, I am comfortable using JavaScript. I have never had a problem accomplishing what I want with it. I mean, just about everything has been written for it, so there's no point in reinventing the wheel, right?"
The fact of the matter is that while I had been building websites since 1995, the extent of my Javascript experience was limited to form validation and triggering/controlling pop-up windows. Pretty sad, huh? Any other task that didn't fall into those 2 categories, I could do some searching and most certainly "find a script" to accomplish what I wanted. Sure, I would never just "cut and paste" something I didn't understand -- that's a rule I've always held myself to, since more often than not every script I would use I would have to customize in one way or another.
My first experience with jQuery was sometime in the year 2008 when I was looking to implement a modal window in an application I was building. I stumbled across a nice JavaScript solution called Thickbox. I remember downloading the files and noticing it required something called "jQuery". I had no idea what it was or why I needed it -- I just plugged it in and configured Thickbox to my likings.
It wasn't until the following spring in 2009 when I began work on an enterprise-level application that I really discovered jQuery and it's full potential. I was always under the assumption that jQuery just provided some AJAX capabilities and more importantly allowed you to do some slick animations (like on Facebook). My misconception of jQuery was made completely obvious. While sure, it does allow you to perform AJAX functionality and slick animations, it is so much more than that. Ever since discovering jQuery, I have never worked on a project that did not include it. It is most definitely a tool that will always remain in my toolbox.
jQuery.com sums it up best: "jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript." I couldn't write a better definition for jQuery if I tried. Being a ColdFusion developer of over 10 years, jQuery instantly clicked with me. The term rapid web development is just so appealing to me. I've dabbled with other languages -- specifically (VBScript) ASP, and couldn't stand that I would have to write 15 lines of code to query a database (oh and don't forget to close out your recordset!), when I could do the same task in 2-3 lines in ColdFusion! jQuery offered the same level of rapid development that I fell in love with with ColdFusion.
<html>
<head>
<title>My Website</title>
</head>
<body>
<script src="jquery.min.js" type="text/javascript"></script>
</body>
</html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<script src="jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("body").append("<p>Hello World.</p>")
});
</script>
</body>
</html>
Before we can really begin writing some jQuery code, there are a few key fundamentals we need to discuss. A proper understanding of the following items will make learning jQuery much easier and help you write code easier and keep it more organized.
So now that we've learned some basic fundamentals of jQuery, let's dissect the code we wrote above to truly understand what's going on and (more importantly) why. First, we're going to create a new jQuery object with a reference to the document, and chain a .ready() function onto that reference to wait for it to load. Once loaded, jQuery will fire the callback method which in this case is our anonymous function containing further code. This code will then create another new jQuery object with a reference to the <body> tag. jQuery will then chain an .append() function which will literally insert the contents of the append() function into the reference we created earlier to the body tag. More simply put, we will insert <p>Hello World.</p> into the <body> tag. Pretty easy when you think about it, right?
jQuery is an extremely easy and powerful JavaScript library to learn and use. It allows you to write better JavaScript code -- faster! This entry was meant to provide a basic understanding of what jQuery is and how to get up and running with it. We stepped through a few core fundamentals that everyone should learn before proceeding to any further jQuery knowledge. These fundamentals will most definitely help you write better jQuery code, and understand exactly what is going on. This blog entry is part 1 of 5 of a series entitled jQuery - A Crash Course for Beginners. The following topics will be elaborated on in subsequent blog entries.
Please stay tuned for these topics! Cheers!
I am currently happily employed and not actively seeking employment at this time. While I appreciate any and all interest in my skill-set, I am currently not available for a full-time hire. If you are interested in my skill-set and would like to hire me on a part-time basis, please contact me.
Contact InformationTo avoid having my personal contact information floating freely through-out the internet, I have withheld my personal contact information from my resume. If you are interested in contacting me, please do so on my contact page.