<!DOCTYPE html>
<html>
<body>
<p>
JavaScript 能够直接写入 HTML 输出流中:
</p>
<script>
function Lecture(name , Teacher)
{
this.nameRFFF = name;
this.teacherFF = Teacher;
}
Lecture.prototype.display= function()
{
return this.teacherFF ;
}
var pLecture = new Lecture("nime","dfffffff")
alert(pLecture.display());
</script>
<p>
您只能在 HTML 输出流中使用 <strong>document.write</strong>。
如果您在文档已加载后使用它(比如在函数中),会覆盖整个文档。
</p>
</body>
</html>
需要注意的是:prototype是小写的,大写的话是没有意义的。
关于函数值得返回必须注意的