请教,关于对象的继承
<body></body>
<SCRIPT LANGUAGE="JavaScript">
<!--
function block(){
var obj=null;
function init(){
obj=document.body.appendChild(window.document.createElement("<div style='background:#00ff00;width:100;height:100'></div>"));
}
this.init= init
this.changeColor = function(color){
obj.style.backgroundColor = color;
}
}
var b1 = new Function("this.init()")----------------A
b1.prototype = new block----------------------------B
var b2 = new b1()
alert(document.body.innerHTML)
b2.changeColor('red')
var b3 = new b1()
alert(document.body.innerHTML)
b3.changeColor('red')
//-->
</SCRIPT>
问题:
我看不懂A,B到底什么意思
只知道语法:子对象.prototype=父对象,上面的表示什么意思呢??
var b1 = new Function("this.init()") 什么意思??Function没定义过,只有function,但是,改成funciton却会出错,高手帮忙啊