KnockoutJS: "My HTML node has disappeared"

This is probably the one question I get asked the most about KnockoutJS. Why is my 'some random html node' not apearing on my page? And this is often followed up with a code sample similar to: <!-- ko foreach: myList --> <th data-bind="text: label&…

Read this article

JavaScript can double your codebase so make sure you need it first

There's been a JavaScript/SPA revolution in the past couple of years. Its now back in fashion and a lot of people are using it. I'm here to tell you it might not be worth it and that you should stick to server side code. I use JavaScript everyday. Our…

Read this article

Saving Key Strokes can bring a World of Pain

Developers seem to fall into two schools of thought on this one. Limit the amount of code you write or leverage the syntax to assure no mistakes are made. I've flirted between the two, but right now I'm heavily in favor of the latter approach. What am I talking about?…

Read this article

Alternatives on the Javascript Constructor Pattern

Had a discussion in @jabbr recently about different ways of implementing the constructor/prototype pattern in javascript and a couple popped up. 1. Implementing the constructor as a function and all the prototype methods in one go: function MyObject(foo, bar) { this.foo = foo; this.bar = bar; }; MyObject.prototype = { constructor:…

Read this article

Custom JQuery Deferred Handlers

As the codebase at work gets bigger and bigger I've been trying to think of ways to simplify some of the simple create and update javascript functionality. Our application works by having a context that you can define a resource for then use to perform the CRUD functionality. For example:…

Read this article

Mousetrap Bind Elements

Shortcut keys are becoming more and more important in today's web, and libraries like mousetrap are a god send when you want to implement them on your site. It allows you to assign various shortcut keys to callback functions. It even allows key combinations. To help simplify the implementation I've…

Read this article

Knockout JSON Viewer Update

I've added a couple of additional features to my jsonViewer, Subscriber count and embedded stylesheet. The green number now shows how many subscribers the observable has, which is good. However, there are a couple of caveats. Firstly, it's important to note, that if a child observable has a subscriber then…

Read this article

Knockout JSON Viewer

Would you know it. Starting another blog. Just wanted to introduce my jsonViewer for knockout. The aim is to make it a little easier to debug your view models. As it can be really difficult to get an idea of what's going on behind the scenes. It shows you the…

Read this article