开发者

jquery weird error in jgrowl

开发者 https://www.devze.com 2022-12-20 15:47 出处:网络
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

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()");.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号