var a=function()
{
 this.click=function()
 {
  alert("A");
 }
}var b =function()
{}b.prototype=new A;

解决方案 »

  1.   

    要用脚本模拟:function test(){
    alert("test function");
    }
    function class1(){
    this.property1="test property";
    this.method1 = test;
    }
    function class2(){
    var parent = new this.superClass();
    for (p in parent){
    this[p] = parent[p]
    }
    }
    class2.prototype.superClass=class1;var obj2 = new class2();
    alert(obj2.property1)
    obj2.method1();上面的class2从class1继承了属性property1和方法method1。
      

  2.   

    javascript is object-based, not object-oriented language.
      

  3.   

    其实flyycyu的回答不但什么都没继承下来,还是根本不能运行的,而且对prototype的使用方式也是不对的。