title: KineticJS: no method '_addId' in anonymous function
body: <p>So, trying to work through the KineticJS.Image tutorial, but I run into an issue.</p>
  
  <p>This works:</p>
  
  <pre><code>$(document).ready( function() { 
    var icon = new Image();    
    icon.onload = function() { 
      var stage = new Kinetic.Stage({ 
        container: 'canvas',      
        width: 730,            
        height: 700,           
      });
      var layer = new Kinetic.Layer();
  
      var im = new Kinetic.Image({    
        x: -14,
        y: -13,
        image: icon,
        width: 30,
        height: 30
      });
      layer.add(im);        
      stage.add(layer);        
    };                         
    icon.src = '#{asset_path "icons.png"}';
  });
  </code></pre>
  
  <p>this, which very nearly the tutorial code, does not:</p>
  
  <pre><code>$(document).ready( function() { 
    var stage = new Kinetic.Stage({
      container: 'targetCanvas',
      width: 730,
      height: 700,
    });
    var layer = new Kinetic.Layer();
    var icon = new Image();    
    icon.onload = function() { 
      var im = new Kinetic.Image({
        image: icon,
        width: 30,
        height: 30,
      });
      layer.add(im);        
      stage.add(layer);        
    };                         
    icon.src = '#{asset_path "designer_icons.png"}';
  });
  </code></pre>
  
  <p>It throws:</p>
  
  <pre><code>Uncaught TypeError: Object #&lt;Object&gt; has no method '_addId' kinetic.js:28
    Kinetic.Container.add
    Kinetic.Stage.add
    icon.onload
  </code></pre>
  
  <p>I could have something Seriously Messed up in my environment, since this is in a serious hack job of a project (Rails w/Backbone,Require,Bootstrap and Kinetic), and I really don't know javascript or various libraries, so I'm fumbling around in the dark.</p>
  
  <p>Any ideas what's causing this and how to fix it?</p>