문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top