<!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是小寫的,大寫的話是沒有意義的。
關於函數值得返回必須注意的