Re: JavaScript - object property
| From: | Marek Kilimajer | Date: | Wed, 27 Apr 2005 07:08:11 +0000 |
| Subject: | Re: JavaScript - object property | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-214001@lists.php.net to get a copy of this message | ||
Eli wrote:
Hi, I know this is not the forum, but I googled and couldn't find it, so please try to help me with this. /*********/ function MyCls(name) { this.name=name; } function SayHi() { alert('Hi, '+this.name+'!'); } var obj=new MyCls('PHP'); obj.name='JavaScript'; //this will call SayHi() function /*********/ I have a class in JS with a property variable in it. How can I execute a function when the property value is changed? Sorry it's off-topic.. -thanks, EliLook at Object's watch() method