Browsing articles from "August, 2011"
Aug
29

Organizing events with jQuery

Following the launch of BackboneFU I wanted to take the time to talk about my current setup when I am not using an MVC framework on the front-end. This will be also part of my presentation at Confoo 2011 (if I’m chosen).

The problem with handling events with jQuery is probably that jQuery itself makes it really easy to make spaghetti code, so only reading the jQuery documentation you are bound to hit a wall at some point. I’m always amazed at junior javascript developers’ code and how they always mess things up if they use jQuery.

Prob #1 Anonymous functions

When you look at the jQuery documentation for events, you would see something like this explaining bind:

$(“#myButton”).bind(“click”, function(){
  1.  $(this).addClass("selected")
  2. })

It’s not because you can use anonymous function to do everything…


Aug
28

Introducing BackboneFU.com, the resources for Backbone.js.. maybe

Well, well, sometimes I feel that I need to start a small project just for the fun of it, this time I created backboneFU. I recently started playing with this framework and while there is a lot of resources about backbone, I feel that it’s missing a community website like railcasts for Rails.

This is why I started BackboneFU, in my wildest dreams it would become the resource for Backbone. Anyone who wants to write about backbone will be accepted on the website, so if you want to write something, or already wrote something on your blog and donate the article also on BakcbonFU, you are welcome to do so. There is a nice bio for authors on each articles.

I also added one article recently, Front-end…


Aug
22

Two headaches explained when you’re getting started with backbone.js

Recently I decided to dive into backbone.js. I tried to write a small project with it but I found it was hard to get into and abandoned. After seeing a presentation of it at JS-Montreal, I finally decided to give it another try and started porting a project I was working on to it.

Personally I find that backbone.js is a weird beast. It’s called an MVC framework, but there is no controller, the events system is completely different from your default PHP/Ruby MVC style and there is a notion of collections. Basically Backbone is a MRVT(Model Route Views Template), scratch that, it’s in fact a MCRVT(Model Collection Route View Template)

So if you are a front-end developer with some MVC knowledge because you are sometimes dealing with a…


RSSSome Tweets