obj={name:'value'};
How to call a function every time when I change an object (adding a new property, removing properties), and when I read the properties (simmered another function)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Have a look at KnockoutJS. This is a very powerful MVVM framework and you would benefit from using it fully to separate model from view logic. But you could also use it just for this specific need (if 40kb if bareable for your needs)… if you look into observables they do what you want: http://knockoutjs.com/documentation/observables.html