javascript class and prototype - function doesn't see variables belonging to 'class'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oll3i
    Contributor
    • Mar 2007
    • 679

    javascript class and prototype - function doesn't see variables belonging to 'class'

    Code:
    function myClass(modul,var1,var2,var3,var4,var5,var6,var7,var8,domainURL){
    this.modul=modul;
    this.var1=var1;
    this.var2=var2;
    this.var3=var3;
    this.var4=var4;
    this.var5=var5;
    this.var6=var6;
    this.var7=var7;
    this.var8=var8;
    this.domainURL=domainURL;
    
    this.prototype.display() {
    display code
    }
    
    }
    this.prototype. display() doesn't see eg this.var1 (or any other variable belonging to myClass)?

    thank You
  • oll3i
    Contributor
    • Mar 2007
    • 679

    #2
    i solved it thank you :)

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Good to know, but the question is how.

      Comment

      Working...