Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
150
rated 0 times [  154] [ 4]  / answers: 1 / hits: 28161  / 13 Years ago, sat, march 12, 2011, 12:00:00

Is there a way in JavaScript to have something like an event that listens to changes in a variable? so when its value is modified the event triggers and then I can call a function. To put this more into context I have a function which handles the html rendering of an array of objects, and I want that function to be called automatically every time the array is modified.



Thanks.


More From » function

 Answers
10

Use object.watchdocs and if it is not supported natively look at this implementation: Object.watch() for all browsers?


[#93317] Thursday, March 10, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
madelyn

Total Points: 449
Total Questions: 100
Total Answers: 100

Location: Seychelles
Member since Fri, May 7, 2021
3 Years ago
madelyn questions
Wed, Jul 28, 21, 00:00, 3 Years ago
Wed, Jul 14, 21, 00:00, 3 Years ago
Sat, Nov 7, 20, 00:00, 4 Years ago
Thu, Sep 3, 20, 00:00, 4 Years ago
;