Re: JavaScript - object property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, Eli


Look at Object's watch() method

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux