Agility.js - Adding HTML safe data bindings

March 14, 2012

Recently I’ve been looking for a good MVC library for Javascript. Backbone.js has it’s perks but it’s code overhead is a bit too high for my liking.

Enter Agility.js! It’s a simple tool that allows for pretty much everything you need to implement MVC patterns in your js. It too, however, is not without it’s own set of problems.

Specifically, it attempts to be strictly MVC. The outcome of this is that your data can not hold HTML content. Indeed, the bindings are set using the jQuery.text() method, thus forcing your data to be interpreted as pure text even if you’ve tried shoving HTML tags into the data. And, while I’m relatively new to the MVC pattern, this kind of locking into place is not all that cool when you’re trying to get things done in a crunch.

So I forked agility to add the ability to have HTML in your data. Sure, it’s messy, sure, it breaks MVC, but when I want to spit out dynamic code, I need to have access to a simpler way to do so then rebuild my entire architecture. This is even more true when we’re supposed to be writing less, one of the other stated goals behind agility.

You can find my public fork at the following link. It’s a simple change, and I haven’t made a pull request yet because I need to test it more but at least it’s out there now.

https://github.com/JamesHagerman/agility


James Hagerman

Written by James Hagerman

© 2026