René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
watch [JavaScript snippet] | ||
function main() { var obj = {}; obj.watch("foo", function(elem_name, old_value, new_value) { txt_out("elem_name: " + elem_name + ", old_value: " + old_value + ", new_value: " + new_value); return new_value.toUpperCase(); }); obj.foo = "foo"; obj.bar = "bar"; txt_out("---"); txt_out("foo: " + obj.foo); txt_out("bar: " + obj.bar); }
See also other Javascript snippets
|