<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function showPerson(p) {
document.write('<p>姓名: <b>' + p.name + '<b/></p>');
document.write('<p>年龄: <b>' + p.age + '<b/></p>');
document.write('<p>教育经历:'+'<p/><ul>');
for(var i=0; i<p.edus.length; i++) {
document.write('<li>' + p.edus[i] +'</li>');
}
document.write('<p>所获奖励: </p><ul>');
for(var i=0; i<p.certs.length;i++) {
document.write('<li>'+p.certs[i].year + '年: 获得' +
p.certs[i].content + '</li>');
}
document.write('</ul>');
}
var person = {name:'小明', age:20};
person.edus = ['云南第一小学', '西安第二初级中学', '北京第三高级中学'];
person.certs = [
{year:1985,content:'奥林匹克数学小学竞赛一等奖'},
{year:1999,content:'市优秀少先队员'},
{year:2004,content:'优秀共青团员'}
];
showPerson(person);
</script>
</head>
<body>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function showPerson(p) {
document.write('<p>姓名: <b>' + p.name + '<b/></p>');
document.write('<p>年龄: <b>' + p.age + '<b/></p>');
document.write('<p>教育经历:'+'<p/><ul>');
for(var i=0; i<p.edus.length; i++) {
document.write('<li>' + p.edus[i] +'</li>');
}
document.write('<p>所获奖励: </p><ul>');
for(var i=0; i<p.certs.length;i++) {
document.write('<li>'+p.certs[i].year + '年: 获得' +
p.certs[i].content + '</li>');
}
document.write('</ul>');
}
var person = {name:'小明', age:20};
person.edus = ['云南第一小学', '西安第二初级中学', '北京第三高级中学'];
person.certs = [
{year:1985,content:'奥林匹克数学小学竞赛一等奖'},
{year:1999,content:'市优秀少先队员'},
{year:2004,content:'优秀共青团员'}
];
showPerson(person);
</script>
</head>
<body>
</body>
</html>