title: My Javascript classes are inheriting attributes from their prototype, but not functions! Why is this?
body: <p>I have a base class here:</p>
  
  <pre><code>function Screen(src) {
  this.src = src;
  }
  
  Screen.prototype.html = function(collapsed) {
      return $.ajax({
          async : false,
          url : this.src + "?collapsed=" + collapsed,
      }).responseText;
  };
  </code></pre>
  
  <p>And then I try to subclass it:</p>
  
  <pre><code>function TitleScreen() {
      Screen.call(this, "title.php");
  };
  TitleScreen.prototype = Object.create(Screen.prototype);
  TitleScreen.prototype.constructor = TitleScreen;
  TitleScreen.prototype.parent = Screen.prototype;
  </code></pre>
  
  <p>However when I do so, and attempt to use a TitleScreen object, it has its src property set, but the html function is not defined! I also tried setting the html function in the constructor, like so:</p>
  
  <pre><code>function Screen(src) {
      this.src = src;
      this.html = function(collapsed) {
          return $.ajax({
              async : false,
              url : this.src + "?collapsed=" + collapsed,
          }).responseText;
      };
  }
  </code></pre>
  
  <p>But that didn't work either. What am I doing wrong that could cause plain old attributes to work but not functions?</p>