Because of the scoping rules, you cannot actually examine the value of the variable that has changed since the event handler is running in a completely different scope chain.
<HTML>
<HEAD></HEAD>
<BODY>
<SCRIPT>
document.watch("myVariable", alert("Watch point triggered"))
document.myVariable = 100;
</SCRIPT>
</BODY>
</HTML>| See also: | Object.assign(), Object.unwatch(), unwatch(), watch() |
| Prev | Home | Next |
| Object.valueOf() | Up | Object property delimiter (.) |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. | ||