4

i have a problem regarding to growl notification in jquery. I have this error in IE (which I know not the best choice to test your code but just to your error in javascript) "Object doesn't support this property or method".

notifyBidding.js

$(document).ready(function(){
 addNotice();
 setTimeout(function(){
 addNotice();
 },4000); 
$('#growl')
 .find('.close')
 .live('click', function(){
 $(this)
 .closest('.notice')
 .animate({
 border: 'none',
 height: 0,
 marginBottom: 0,
 marginTop: '-6px',
 opacity: 0,
 paddingBottom:0,
 paddingTop:0,
 queue:false
 },1000, function(){
 $(this).remove();
 });
 });
});
function addNotice(){
$('#growl')
.append($('<div id="bidTo"></div>').html($('<img id="bg2" src="notification.png" width="250" height="75"></img><p id="tag2">This item is about to end</p><img id="dp2" src="temporary.jpg"/><p id="bidTime" style="font-family:arial narrow; font-size:12; color:rgb(171,14,21); text-transform:uppercase; position:absolute; top:25px; left:85px"><b>about to end</b></p>')))
.hide()
.appendTo("#growl")
.fadeIn(1000)
.fadeOut(3000)
$('#bidTo').contents().unwrap();
}

welcome.php

<html>
 <head>
 <link rel="stylesheet" type="text/css" href="design2.css"/>
 <script type="text/javascript" src='script.js'></script>
 </head>
 <script type="text/javascript" src="jquery-1.11.0.min.js"></script>
 <script src="jquery-1.11.0.min.js"></script>
 <script src="jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js"></script>
 <script src="notification.js"></script>
 <script src="notifyBidding.js"></script>
<body>
<a id='imgCart' href='#'></a>
<div id='notification' >
 <img id='bg' src='notification.png' width='1110' height='65'></img>
 <p id='tag'>There are still &nbsp;&nbsp; in your shopping cart</p>
 <p id='noToPay'>5</p>
</div>
<div id='growl'></div>
</body>
</html>
asked Mar 21, 2014 at 9:13
4
  • api.jquery.com/live is deprecated As of jQuery 1.7 check your jquery version. Commented Mar 21, 2014 at 9:16
  • @AbhikChakraborty Deprecated doesn't mean it doesn't exist. It was, however, removed entirely at some point (I think version 1.9), so they do need to include the version of jQuery they're using. Commented Mar 21, 2014 at 9:17
  • What is the line where you have this error? Use .on instead of .live, .live is deprecated Commented Mar 21, 2014 at 9:17
  • how about the function .validate? Is it also deprecated? not working to me also. :( Commented Mar 21, 2014 at 12:11

1 Answer 1

5

You need to put your <script> in the <head> section or before closing </body> tag of your page.

<head>
 <link rel="stylesheet" type="text/css" href="design2.css"/>
 <script type="text/javascript" src='script.js'></script>
 <script type="text/javascript" src="jquery-1.11.0.min.js"></script>
 <script src="jquery-1.11.0.min.js"></script>
 <script src="jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js"></script>
 <script src="notification.js"></script>
 <script src="notifyBidding.js"></script>
</head>

Also, since you're using jQuery version 1.11 and .live() has been removed in version 1.9, you need to use .on() instead , so you can change:

$('#growl').find('.close').live('click', function(){ .....

to:

$('#growl').find('.close').on('click', function(){ .....

Besides that, if your scripts.js utilize jQuery or other plugins, you must include it after you've included jQuery and other plugins.

Last note is that you just need to include jQuery once instead of twice like what you're doing at this moment.

answered Mar 21, 2014 at 9:16
Sign up to request clarification or add additional context in comments.

1 Comment

That's all your honour ;)

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.