以下代码明明按照视频写的,怎么会没有运行结果,求分析,是不是我的DW软件和老师用的软件版本不同啊
<!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>
</head>
<body>
<script type="text/javascript">
function Person(name,age)
{
this.name = name;
this.age = age;
this.setName = funtion(n)
{
this.name = n;
}
this.getName = funtion()
{
return this.name;
}
}
var p = new Person("lisi",33);
p.setName("wangwu");
alert(p.getName());
</script>
</body>
</html>
网页错误详细信息
用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727)
时间戳: Mon, 14 Jan 2013 06:07:57 UTC
消息: 'n' 未定义
行: 16
字符: 2
代码: 0
URI: file:///K:/java%20study/day28/jaobject.html
|