Skip to content

Instantly share code, notes, and snippets.

@kouphax
Created October 16, 2010 17:33
Show Gist options
  • Save kouphax/630059 to your computer and use it in GitHub Desktop.
Save kouphax/630059 to your computer and use it in GitHub Desktop.
var user = {
username: 'jameshu',
fullName: 'James Hughes'
};
$(user).bind("changeData", function( event, name, value ) {
console.log(name + " changed to " + value);
});
$(user).data("username", "jameshu2");
// => username changed to jameshu2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment