phoenixshade
Mar 15th, 2007, 09:04 AM
I would like to construct object classes with properties and methods that I define. I'd like to be able to use these with a syntax similar to that of the pre-constructed javascript objects. For example, if I have an object foo and I define a property bar, I'd like to be able create an instance of foo like this:
var x = new foo... and I'd like to get the property bar for this instance like this:
var y = x.bar... and set the property using this:
x.bar = y
Is this even possible in javascript? And if so, could someone either provide me with a simple example of how it's done, or better yet, a decent reference or tutorial written in English (not CompSci Jargon)?
Thanks much for any help.
var x = new foo... and I'd like to get the property bar for this instance like this:
var y = x.bar... and set the property using this:
x.bar = y
Is this even possible in javascript? And if so, could someone either provide me with a simple example of how it's done, or better yet, a decent reference or tutorial written in English (not CompSci Jargon)?
Thanks much for any help.