Result of expression 'xxxx' is not a constructor in JS
- by Pselus
Trying to create an object in Javascript (for Appcelerator/Titanium).
The "object" is defined like this:
function server () {
this.cacheimages = 0;
this.login = "";
this.name = "";
this.root = "";
this.signup = "";
this.useimages = 0;
this.userexists = "";
this.isdefault = 0;
return this;
}
In the same file, in another function when I run this line: var server = new server(); I get the error Result of expression 'server' is not a constructor.
I have tried it with and without the "return" line, neither work. What am I doing wrong?