Hello -
I would like to add a method to one of the element classes. Is this
possible?
So let's say I have -
<label name="chickens" x="5" />
And let's say for example, I would like to do this in my code:
var x = chickens.getX();
Ideally I would do that by adding a function like this:
label.prototype.getX = function() { return this.x; }
(Of course, this is a lame example, since there's no reason to write a
function just to return the value of x. But there are reasons you
might want to define a new method.)
Now when I actually try it, I get an error that label.prototype is
undefined. So clearly I'm missing something. Either there's no way to
modify an element class, or it's named something other than "label".
thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Desktop Developer Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---