我试图运行下面的脚本来理解Javascript对象和继承,但没有看到任何显示内容。加载文档时出现javascript错误
<html>
<head>
<script>
$(document).ready(
function Person(){
alert('New Person Created');
}
Person.prototype.sayHello = new function(){
alert('Hello');
};
var x = new Person();
x.sayHello();
var newfunction = x.sayHello;
newfunction.call(Person);
);
</script>
</head>
<body>
</body>
</html>
你应该习惯于发现日志中的错误,这是你的第一课:) – David