Hi all.
I'm probably doing something stupid but I can't get started with OO in Javascript. (It's been a while.) Nothing is working properly. My latest mistake is:
I get "Uncaught ReferenceError: 'Class' is not defined" in the Extensions debugger, just under the "var Blob" line. Do I need to include something?Code:var Blob = Class.create({ initialize: function(text) { this.text = text; this.count = 0; } });
Before that I tried:
which seemed to work, until I noticed that member "this" pointed at the DomWindow. Not what I need at all.Code:function Blob(text) { this.text = text; this.count = 0; } Blob.prototype = { }
Can someone give me a working example of a class, since I appear to be too thick to work it out myself?![]()
I'm running chromium-browser 8.0.561.0 (63476) Ubuntu 10.04, if that sheds any light on my problem.
Thanks.


LinkBack URL
About LinkBacks




Reply With Quote
