【发布时间】:2014-05-21 06:54:47
【问题描述】:
Uncaught InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable.
在这行代码中发生了:
var nodeIconImg = new Image();
var nodeIcon = new Kinetic.Image({
image: nodeIconImg,
width: 30,
height: 30,
cornerRadius: radius
});
if(node.main_photo == 'no_photo.png')
{
var url = '<?= URL::to(''); ?>/img/' + node.main_photo;
nodeIconImg.src = url;
}
我正在使用动力学 js,字符串是正确的,图像文件存在,但是在我分配 src 后发生错误,无法弄清楚,我也试过这个:
var url = escape('<?= URL::to(''); ?>/img/' + node.main_photo);
但它没有帮助,有什么想法吗??
这个错误是什么意思?我能做些什么来解决它?
【问题讨论】:
-
你能创建任何 jsfiddle 演示吗?
标签: javascript php image canvas kineticjs