This may seem silly, but in this day and age, one should be able to expect JS to raise an event if contents of an array have changed.
A few questions been asked regarding getting notified when a variable changes (define getter or setter). And there seems to be a way to do that (at least for most browsers including IE6+)
My issue is that I'm trying to get notified if an item inside an array changes:
var ar = ["one", "two", "three"];
// setting the whole array will call the custom setter method
// (assuming you defined it)
ar = ["one", "three", "five"];
// however, this will only call the getter method and won't call the setter
// without defining custom setters for every item in the array.
ar[1] = "two";
Obviously, I'm trying to avoid forcing the coder to use old-school Java style .getVale()
and .setValue()
functions to access/modify data.