3,248
社区成员




<html>
<body>
<script type="text/javascript">
function cat()
{
// Create new element and assign the value 10
this.Bar = 10;
}
function test()
{
// Construct new object
Obj = new Object();
// Create new element and assign function pointer
Obj.Elem = cat;
// Call Elem method ("this" == Obj)
Obj.Elem();
// Obj.Bar now exists
}
test();
</script>
</body>
</html>