Hey all,
So I know javascript pretty well, but I'm not sure about this one.
Tough to explain so I'll just show it:
var view = new View();
view.rating = 4.5;
Is there anyway to have view.rating be called as a function to manipulate the DOM a bit and set that rating to five?
So in View:
View.prototype = {
rating : function() {
$('div.stars').width(4.5);
}
}
I know there are workarounds, using something other than "view.rating = 5". I'm not interested in those. I'm wondering if there is a way to set this up maintaining view.rating = 5. This is coming JS is coming straight from PHP essentially and I don't want to bog the PHP down with anonymous functions.. like view.rating = function() {...};
Thanks! Matt Mueller