Is it possible to have an event in JS that fires when the value of a certain variable changes? JQuery is accepted.
Not directly: you need a pair getter/setter with an "addListener/removeListener" interface of some sort... or an NPAPI plugin (but that's another story altogether).