日期:2014-05-16  浏览次数:20269 次

js如何读取硬件里的可调用类的全部内容?
普通HTML页面有一段JS代码

这段代码写的是一个简单的类
比如

HTML code

<html>
<head>
<script type="text/javascript">
function myClass()
{
//假设以下隐藏
    this.name;
    this.play = function()
    {
        //..
    }
//假设以上隐藏
}
</script>
</head>

<body>
</body>
</html>



现在假设我只知道有myClass这么一个类,但不知道类内部是怎么写的。
我怎样才能知道myClass这个类里面的代码是怎么写的呢?





------解决方案--------------------
<html>
<head>
<script type="text/javascript">
function myClass()
{
//假设以下隐藏
this.name;
this.play = function()
{
//..
}
//假设以上隐藏
}
myobj = new myClass()
for(key in myobj){
document.write(key+":"+myobj[key].toString()+"<br>"
}
</script>
</head>

<body>
</body>
</html>

------解决方案--------------------
HTML code
<html> 
<head> 
<script type="text/javascript"> 
function myClass() 
{ 
//假设以下隐藏 
    this.name; 
    this.play = function() 
    { 
        //.. 
    } 
//假设以上隐藏 
} 
myobj = new myClass() 
for(key in myobj){ 
document.write(key+":"+myobj[key].toString()+" <br>"); 
} 
</script> 
</head> 

<body> 
</body> 
</html>

------解决方案--------------------
function classA()
{
this._name="hello";
}

window.alert(classA.toString());
------解决方案--------------------
js的类为什么会看不到阿?不是都可以下载的吗?
------解决方案--------------------
关注
------解决方案--------------------
"被集成到硬件里面去了"
????,怎么集成的?
------解决方案--------------------
有些会显示成native code
------解决方案--------------------
你是想看myClass这个函数的写法吗??
HTML code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<script type="text/javascript">
<!--
function myClass(a){
this.a=a;
alert("OK");
}
alert(myClass.toString());
//-->
</script>
</head>
<body>
</body>
</html>

------解决方案--------------------

------解决方案--------------------
我也想了解,谢谢LZ.
------解决方案--------------------
var o=new myClass()
for(i in o)
{
alert("o["+i+"]="+o[i]);
}