Search code examples
kineticjs

KineticJS Error: a.getType is not a function


My code works in jsfiddle but doesn't work when I paste it in a .html file with Notepad. I'm only using KineticJS v.5.0.1. This is the console error that I get:

TypeError: a.getType is not a function

Here's my code http://jsfiddle.net/4Y87X/4/. The error disappears when I delete the "window" which is a Kinetic.Rect that I'm trying to add to a group. Do I have to add something?


Solution

  • I'm pretty sure that calling a var window is a really really true bad idea.

    Rename window as something like "wind" and everything will be OK.

    Window is an environment global var that refer to the browser's window. So, overwriting it is a problem.