87,996
社区成员




CType = function(Text)
{this.nType = GetType(Text);}
CType.GetType = function(Text)
{/* ... */}
// ...
Type = new CType(Str);
CType = function(Text)
{this.nType = this.GetType(Text);}
CType.prototype.GetType = function(Text)
{return Text + "1";}
Type = new CType("abc");
alert(Type.nType);
<html><body><script type="text/javascript">
CType = function(Text)
{
// this.nType = CType.GetType(Text);
// this.nType = arguments.callee.GetType(Text);
//! this.nType = this.prototype.constructor.GetType(Text);
this.nType = this.constructor.GetType(Text);
//! this.nType = GetType(Text);
// this.MyGetType = function(Text) {return CType.GetType(Text);}
//! this.MyGetType = function(Text) {return arguments.callee.GetType(Text);}
//! this.MyGetType = function(Text) {return this.prototype.constructor.GetType(Text);}
this.MyGetType = function(Text) {return this.constructor.GetType(Text);}
//! this.MyGetType = function(Text) {return GetType(Text);}
}
CType.GetType = function(Text) {return Text;}
// ...
Type = new CType("OK");
document.write("Type.nType: " + Type.nType + "<br />");
document.write("Type.MyGetType(): " + Type.MyGetType("OK") + "<br />");
</script></body></html>
<html>
<body>
<script type="text/javascript">
CType = function(Text)
{
this.nType0 = CType.GetType(Text);
this.nType1 = arguments.callee.GetType(Text);
this.nType2 = this.prototype.constructor.GetType(Text);
this.nType3 = GetType(Text);
this.MyGetType0 = function(Text) {return CType.GetType(Text);}
this.MyGetType1 = function(Text) {return arguments.callee.GetType(Text);}
this.MyGetType2 = function(Text) {return this.prototype.constructor.GetType(Text);}
this.MyGetType3 = function(Text) {return GetType(Text);}
}
CType.GetType = function(Text)
{return Text;}
// ...
Type = new CType("Hello");
alert("Type.nType0: " + Type.nType0);
alert("Type.nType1: " + Type.nType1);
alert("Type.nType2: " + Type.nType2);
alert("Type.nType3: " + Type.nType3);
alert("Type.MyGetType0(): " + Type.MyGetType0("World"));
alert("Type.MyGetType1(): " + Type.MyGetType1("World"));
alert("Type.MyGetType2(): " + Type.MyGetType2("World"));
alert("Type.MyGetType3(): " + Type.MyGetType3("World"));
</script>
</body>
</html>
CType = function(Text)
{this.nType = CType.GetType(Text);}
CType.GetType = function(Text)
{/* ... */}
// ...
Type = new CType(Str);