<html>
<head>
<SCRIPT LANGUAGE = " JavaScript ">
Object.prototype.toString = function () { return 'myToString'}
var o = new Object();
o.name = 'zkj';
o.age = 25 ;
o.desc = function () { return '姓名:' + this .name + ',年龄:' + this .age}
for ( var key in o) {
alert(key + ':' + o[key] + ' type:' + typeof (o[key]));
if ( typeof (o[key]) == ' function ') {
alert('执行方法key:' + (o[key])());
}
}
alert(o);
alert( new Date());
</SCRIPT>
</head>
<body>
</body>
</html>请大虾帮忙改下!
<head>
<SCRIPT LANGUAGE = "JavaScript">
Object.prototype.toString = function () { return 'myToString'}
var o = new Object();
o.name = 'zkj';
o.age = 25 ;
o.desc = function () { return '姓名:' + this .name + ',年龄:' + this .age}
for ( var key in o) {
alert(key + ':' + o[key] + ' type:' + typeof (o[key]));
if ( typeof (o[key]) == 'function') {
alert('执行方法key:' + (o[key])());
}
}
alert(o);
alert( new Date());
</SCRIPT>
</head>
<body>
</body>
</html>这个已经可以了
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<script type="text/javascript">
<!--
Object.prototype.toString = function() {
return 'myToString';
};
var o = new Object();
o.name = 'zkj';
o.age = 25 ;
o.desc = function() {
return '姓名:' + this .name + ',年龄:' + this .age;
};
for (var key in o) {
alert(key + ':' + o[key] + ' type:' + typeof (o[key]));
if ( typeof(o[key]) == 'function') {
alert('执行方法key:' + (o[key])());
}
}
alert(o);
alert(new Date());
//-->
</script>
</body>
</html>
javascript 这儿也不能有空格