March 24, 2011 – 12:40 am
After taking Stephen’s comment into account on my last post, I’ve decided to turn the code into a jQuery plugin. Being a boring, and very unimaginative, developer I decided to call it jqml (grab the source here). Compressed, the code is under 1/2KB. The same method is used to generate element attributes that is used [...]
I created my first jQuery pull from my fork[link] request over the weekend. It contains a small update to support native JSONML support in the core. One really cool feature in jQuery is the ability to build an element and pass an object with all the attributes you wish to assign. Here’s an example: 1234567$(’<p [...]
January 26, 2011 – 12:20 am
While working with Taffy DB the other day I got a strange idea of how to create an object that supports multiple instances, and happens to be immutable-ish: 12345678910111213141516171819202122(function(window, undefined) { function privateFunc(val) { this.val = val; }; privateFunc.prototype.print = function() { [...]
January 24, 2011 – 9:46 pm
While working in JavaScript I like to execute my code through Node.js from my editors terminal for quick testing. Unfortunately the usual pattern of wrapping code doesn’t quite work: 123(function(window, undefined) { // code here… })(window); Luckily the fix was pretty simple. By replacing window with this we have access to the Node.js [...]