Tag Archives: javascript

jqml – jQuery JSONML plugin

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 [...]

jQuery pull request for JSONML support

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 [...]

javascript immutable emulation

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() {       [...]

code share with Node.js and the browser

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 [...]