You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: jquery.countdown and jquery-countdown are different repos. Save yourself hours, be sure to install jquery-countdownnotjquery.countdown.
Simply stated: .countdown is not defined in jquery.countdown, rather, it is camel case, i.e. .countDown. Thus, Uncaught TypeError: $(...).countdown is not a function is the correct outcome / output if one is after TFC, but has erroneously installed jquery.countdown instead of jquery-countdown. So, if one has 'done everything right' and yet remains flummoxed (e.g. 'why won't this silly package update past v1.2.8...??') odds are, this is the culprit.
Having used this handy dandy library in the past, but not for some time, and battling this dread error again, I would be remiss not to clearly, once and for all, briefly articulate the precise nature of the exact error by which so many have undoubtedly been led astray. It is simply this:
It is the difference between the "." and the "-". jquery.countdown and jquery-countdown are two different libraries. The instructions -- at The Final Countdown - jQuery.countdown page, for instance -- do not make that distinction clear, in fact leading to the error. The libraries are inadvertently somewhat comingled throughout the docs and issues, such that jquery.countdown is being pulled down, and jquery-countdown is being called. So, one must make sure to installjquery-countdownand notjquery.countdown.
For the record, [email protected] and [email protected] (latest, currently, for jQuery v2.2.0) work. So for example, with them installed (in that order, obviously, and correct paths called) this:
<divid="christmas-countdown"></div>
works with this:
<scripttype="text/javascript">
$("#christmas-countdown")
.countdown("2022/12/25", function(event) {$(this).text(event.strftime('%D days %H hrs %M min %S sec'));});
</script>
And require('jquery-countdown') is not 'required' (unnecessary). I hope that helps someone down the line -- perhaps even me... next time...
P.S. Sorry about the book. It was catharsis...
The text was updated successfully, but these errors were encountered:
TL;DR: jquery.countdown and jquery-countdown are different repos. Save yourself hours, be sure to install
jquery-countdown
notjquery.countdown
.Simply stated:
.countdown
is not defined injquery.countdown
, rather, it is camel case, i.e..countDown
. Thus,Uncaught TypeError: $(...).countdown is not a function
is the correct outcome / output if one is after TFC, but has erroneously installedjquery.countdown
instead ofjquery-countdown
. So, if one has 'done everything right' and yet remains flummoxed (e.g. 'why won't this silly package update past v1.2.8...??') odds are, this is the culprit.Having used this handy dandy library in the past, but not for some time, and battling this dread error again, I would be remiss not to clearly, once and for all, briefly articulate the precise nature of the exact error by which so many have undoubtedly been led astray. It is simply this:
It is the difference between the "." and the "-". jquery.countdown and jquery-countdown are two different libraries. The instructions -- at The Final Countdown - jQuery.countdown page, for instance -- do not make that distinction clear, in fact leading to the error. The libraries are inadvertently somewhat comingled throughout the docs and issues, such that
jquery.countdown
is being pulled down, andjquery-countdown
is being called. So, one must make sure to installjquery-countdown
and notjquery.countdown
.For the record,
[email protected]
and[email protected]
(latest, currently, for jQuery v2.2.0) work. So for example, with them installed (in that order, obviously, and correct paths called) this:works with this:
And
require('jquery-countdown')
is not 'required' (unnecessary). I hope that helps someone down the line -- perhaps even me... next time...P.S. Sorry about the book. It was catharsis...
The text was updated successfully, but these errors were encountered: