全,
我使用jgrowl来显示某些内容,今天我收到了这个奇怪的错误
$(this).data("jGrowl") is undefined in jquery.jgrowl_compressed.js file in line 59这给我指出了下面这条线,
$(this).data("jGrowl").created=new Date();在我的项目js文件中,我有以下代码
if (data)
{
$('.jGrowl-notification:contains("' + oldtext + '")').remove();
$.jGrowl.defaults.poll = 1;
$.jGrowl(data, { animateOpen: { height: 'show'}, glue : 'after' , position : 'bottom-right'});
oldtext=data;
clean();
}
function clean()
{
$('.jGrowl-notification:contains("' + oldtext + '")').remove();
}当我尝试打开菜单时出现错误,在它打开之前我再次打开它。
知道哪里出问题了吗。
谢谢。
发布于 2010-02-21 05:57:12
根据the API for .data()的说法,语法应该是$(this).data("jGrowl_created", new Date());或类似的语法。也许你更想要$(jGrowlElement).data("created", new Date()");。
https://stackoverflow.com/questions/2303870
复制相似问题