jquery weird error in jgrowl
All,
I use jgrowl to display certain content ,and i had got this weird error today
$(this).data("jGrowl") is undefined in jquery.jgrowl_compressed.js file in line 59
which points me to the followong line,
$(this).data("jGrowl").created=new Date();
开发者_StackOverflow社区
And in my project js file i have the following code
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();
}
I get the error when i try to open the menu and before it opens i open it again..
Any idea what might be wrong.
Thanks.
According to the API for .data()
the syntax should be $(this).data("jGrowl_created", new Date());
or something like it. Perhaps you'd rather want $(jGrowlElement).data("created", new Date()");
.
精彩评论