【发布时间】:2012-04-12 10:02:02
【问题描述】:
我有一个这样的对象:
function ImageHolder(Attributes, Parent)
{
this.Id = Attributes['Id'];
this.Parent = Parent;
this.Element = $('<div/>');
this.msg = "hello world";
this.Parent.append(this.Element);
this.handleDrop = function(e, ui)
{
alert(this.msg);
};
this.Element.droppable({drop: this.handleDrop});
}
然后我创建一个像这样的对象:
holder = new ImageHolder(A,B);
但是当我尝试将一些东西放到元素上时,我得到了这个错误:
this.msg is undefined
我在这里做错了吗?
【问题讨论】:
标签: javascript jquery object droppable