<script language="JavaScript">
function TT(a,b)
{
this.a = a;
this.b = b;
this.set = function(){
this.c = a*b;
}
this.get = function(){
return this.c;
}
}
function setoTT(oName)
{
window[oName] = new TT(2,5); // 这句是关键.
}
setoTT('oTT');
eval('oTT').set();
alert(eval('oTT').get());
</script>