The morning was spent on the last two jQuery assignments. I went to the library in downtown San Jose again to study with my classmates. Yesterday there were four other classmates in attendance but today there was only one. The energy wasn't as high as it had been yesterday.
The first assignment was to download a webpage, locate the javascript errors and fix them. I've had problems like these in college and usually the errors are obvious. I spent an hour looking through what appeared to be a normal webpage that oddly wouldn't work. The instructors were much more clever than my professors at hiding the mistakes. I thought I didn't need any help and I did feel a little embarrassed to look over at the answer sheet for a hint or two. The second assignment was a play off the assignments from last night. For this one we had to make an object change images when you hover the mouse over it and change it back to its original image when you hover out. Going off of last night I extracted the image's attribute and changed the image source when the mouse hovered in. When the mouse hovered out I reinserted the original image using a temporary variable placed before the hover method that saved the original image. I hope my explanation is not too complicated.
When it was over I took a step back and admired what I had done. Years ago I was doing calculus and every time I finished a problem I couldn't help but pause and admired the way I had written out and solved a problem. It was like poetry the way all those numbers and variables moved around so sensibly.
A webpage is divided into three part: HTML, CSS, and Javascript. HTML gives it the outline, CSS makes it pretty, and Javascript makes it move. Individually each part wouldn't make sense but when coordinated perfectly the feeling is as rewarding as solving a calculus problem. Just take a look at the assignment's code and you'll see what I feel.
HTML:
CSS:
Javascript:
Final Result:
It was never this simple in college. All those projects and all those lines of code that just drove me crazy to understand. The CSS page would be filled with a hundred lines just to make an object sit still. There'd be multiple scripts placed before and after the body, each one for a different task. I thank Bootstrap and jQuery for making things so much easier.
After lunch I begun the advanced jQuery chapter. Like most of yesterday I spent the afternoon understanding the material before I began the workload. And just like yesterday I started the assignments later in the day and still have a few more to cover by tomorrow. I finally figured out what a callback is; it's like a module in Ruby. It helps reduce redundancy in the code, promoting the DRY (Don't Repeat Yourself) principle.
The final assignment I completed before I began this entry was an optional assignment with instructions to create a form that would accept inputs, display them, and make them interactive. I am sad to say that while I did complete it I didn't make it perfect: the forms wouldn't clear up after an entry was inserted, meaning that the same entry could be made multiple times, and the interactivity wouldn't stop when I wanted it to. In the end I didn't go all the way with it. There was no celebration for this victory.
Tomorrow is the Yellow Belt Test. I think I got the login issue squared away and so I'm set for it. It's just going to be constructing a web page using HTML and CSS. I'm going to email the instructor tonight to see if I could use Bootstrap. Bootstrap wasn't covered last week but it still counts as HTML and CSS. So it's worth asking.
No comments:
Post a Comment