<SCRIPT LANGUAGE="JavaScript">
<!--
function demo(){
var talk = "hello";
this.say= function(){
return this.talk;
}
}//实例化2个类var d1 = new demo();
alert(d1.constructor.toString().match(/function\s+([^ \(]+)\s*\(/i)[1])
//-->
</SCRIPT>
<!--
function demo(){
var talk = "hello";
this.say= function(){
return this.talk;
}
}//实例化2个类var d1 = new demo();
alert(d1.constructor.toString().match(/function\s+([^ \(]+)\s*\(/i)[1])
//-->
</SCRIPT>
obj.demo = function(){
var talk = "hello";
this.say= function(){
return this.talk;
}
}
有没有办法得到?