Week 6 Day 3 – Twitter with AJAX
Good morning all! Just a real quick note, Assessment 5 has been dominated. I’m feeling good, and really starting to crank up my momentum and confidence again. I came into the assessment extremely nervous, and as everyone says, the nervousness was unfound. But I do have this feeling that they made the assessment fairly easy on purpose, given at this point, they don’t serve to gain anything from dismissing anyone once they’ve made it this far.
That said, let’s move onto AJAX! AJAX is pretty awesome. It allows for the live inserting of new elements onto the page upon submission WITHOUT having to refresh and rebuild the entire page. For example, this is how tweets work. When you create a new tweet, you compose a tweet and submit it to the server. Rather than reload the entire page, the request is submitted to the server, and the new tweet is added right to the top. The same goes for loading new older tweets at the bottom of the page.
So utilizing this concept, my partner and I built a basic clone of twitter. It was pretty cool to see things slowly take place. We first started with learning about AJAX request and jQuery event handling by preventing the default action of the submit button, and instead redirecting it to build the tweet and prepend it onto the feed, rather than re-rendering the page. We then built the “load more” capabilities and general formatting.
Overall, I hate to admit it, but I’m starting to appreciate the power of JavaScript over Ruby. But I think I’ll always like Ruby more based on how verbose and easy to use it is.
I think that’s it for now! I gotta catch up on homework, given that I basically chose to study for the assessment over doing the homework readings and assignments. Until tomorrow, take care!