What's key-value observing?
Key-value observing allows you to be notified when an attribute value is changed on an object. Let's say you have a profile, and that profile has a number of properties, such as a name. This will update the document title according to whatever the name is set to:
$(profile).kvobserve("name", function(event, newvalue, oldvalue) { document.title = "WidgetCorp - " + newvalue + "'s profile"; });
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.