views:

118

answers:

1

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

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.

+2  A: 

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

chelmertz
Yes the problem is related to this ,but i tried the thing you had told and jgrowl doesnt close by itself if we apply the above said things by you..
Hulk
Perhaps it's a compability issue with jQuery and your version of jGrowl, because it seems the code from their library is written poorly (if "$(this).data("jGrowl").created=new Date();" is from their lib)
chelmertz
Any suggestions.
Hulk
Try updating both jQuery and jGrowl. If that still doesn't work, I think you should correct the jGrowl code (if it indeed is wrong.)
chelmertz
Ki will do that.
Hulk