-
Watching variables
I was just wondering how you have basically an event attached to a variable. So when it changes a function is called. Can it be done, and if so is it cross browser?
-
-
You can use a poll, which is a looping function (using setInterval or setTimeout) that periodically checks the value of the variable involved and then does something if it changes. However, in almost all cases, it is better to simply have the event or script code that changes the variable's value in the first place also do whatever needs to be done when that variable is changed.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks