当前位置: 首页 > 网络学院 > 客户端脚本教程 > JavaScript > JavaScript toSource() 方法
The toSource() method represents the source code of an object.
toSource()方法指明一个对象的源代码
object.toSource() |
Note: This method does not work in Internet Explorer!
注意:IE不支持此方法
In this example we will show how to use the toSource() method:
在本例中,我们将演示如何使用toSource()方法:
<script type="text/javascript"> function employee(name,jobtitle,born) var fred=new employee("Fred Flintstone","Caveman",1970) document.write(fred.toSource()) </script> |
The output of the code above will be:
输出结果为:
({name:"Fred Flintstone", jobtitle:"Caveman", born:1970}) |
toSource()
In this example we will show how to use the toSource() method.
早本例中,我们将演示如何应用toSource()方法