Q:

How to extend data recursively with jQuery.data?

I'm looking for a better way to do this:
var extended = $.extend(entity.data('namespace'), {
    att1    : whatever,
    att2    : whatever
});
entity.data('namespace', extended);

Any suggestions?

A:

.data() doesn't know how to extend. If you want to extend, you have to do it yourself with jquery's .extend() method. Recursive extension can be achieved by placing true as the first parameter, so:
entity.data('namespace', $.extend(true, entity.data('namespace'), { ... }));

