Search code examples
javascriptjqueryajaxcountdown

$().countdown is not a function


I have got this line in my code

$('#timeLeftDiv').countdown({ until: expires, timezone: 0, serverSync: serverTime, onTick: serverTime, tickInterval: 60 });

and it is giving me this error

TypeError: $("#timeLeftDiv").countdown is not a function

The contents of the timeLeftDiv are refreshed Ajaxily. Does this have anything to do with it?

I have included this line in my code

<script src="/<path>/jquery.countdown.min.js">

What am I missing?


Solution

  • might be the missing </script> tag.

    assuming you have included jQuery before, try:

    <script type="text/javascript" src="/<path>/jquery.countdown.min.js"></script>