PDA

View Full Version : Help! I'm lost.



???
03-01-2009, 03:43 PM
This code:


var Class = function (class) {
return Object (function () {
var props = new Object ();
props.inherit = true;
props.super = function (class) {
return function () {
class.apply (props,arguments);
};
};
if (typeof this.inherit != "undefined") {
props.private = this.private;
props.public = this.public;
}
else {
props.private = new Object ();
props.public = this;
}
class.apply (props,arguments);
});
};

It works fine in Firefox, but IE says at line 2, char 23, "expected identifier". I have no idea what that means. Line 2, char 23, is right about in the middle of my second "function". Please help me!

Thanks,
Stephen

Twey
03-01-2009, 08:33 PM
'class' is a reserved word.

???
03-02-2009, 07:08 PM
The capital one or lowercase, or both?

Snookerman
03-02-2009, 08:40 PM
All variations of a word should be avoided to avoid confusion as some browsers ignore capitalization.
http://javascript.about.com/library/blreserved.htm (http://javascript.about.com/library/blreserved.htm)

Good luck!