SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Mentor silver trophybronze trophy
    alabamaseo's Avatar
    Join Date
    Dec 2012
    Location
    Birmingham, AL
    Posts
    203
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)

    Trouble Setting Up Countdown Timer

    Hello everyone, please forgive my ignorance in regards to JS, it is certainly not my strong suit.

    I am trying to install a JS countdown plugin (http://countdownjs.org/) on a blank Wordpress template, but for some reason, I can not get the it to display. I want to start a countdown clock, only counting by days, until March 31, 2014.

    I am calling the countdown.js file from my root directory in the <head>, and I have this code where I want the program to generate the result:

    Code:
    <script>
    var timespan = countdown(start|callback, end|callback, units, max, digits);
    countdown.ALL =
    	~countdown.MILLENNIA |
    	~countdown.CENTURIES |
    	~countdown.DECADES |
    	~countdown.YEARS |
    	~countdown.MONTHS |
    	~countdown.WEEKS |
    	countdown.DAYS |
    	~countdown.HOURS |
    	~countdown.MINUTES |
    	~countdown.SECONDS |
    	~countdown.MILLISECONDS;
    
    countdown.DEFAULTS =
    	countdown.YEARS |
    	countdown.MONTHS |
    	countdown.DAYS |
    	countdown.HOURS |
    	countdown.MINUTES |
    	countdown.SECONDS;
    countdown( new Date(2013, 3, 31) ).toString();
    ts.toHTML() => "<span>5 years</span>, <span>1 month</span>, <span>19 days</span>, <span>12 hours</span>, and <span>17 minutes</span>"
    </script>
    Can someone please help me learn what I am doing wrong?
    Levy's Fine Jewelry- buyers and sellers of modern, antique, and estate jewelry

  2. #2
    SitePoint Addict bronze trophy
    Join Date
    Sep 2005
    Posts
    317
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Do you have the firebug addon for firefox? Run your website in that and see what the javascript warning error message is. It might help you debug whatever is going wrong or at least point you in the right direction.

  3. #3
    SitePoint Mentor silver trophybronze trophy
    alabamaseo's Avatar
    Join Date
    Dec 2012
    Location
    Birmingham, AL
    Posts
    203
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    As far as I can tell, there is no obvious problems. The meta data is pointing to the right .js file, but I am not able to see anything.

    Is there anything else that could be causing problems?

    Thank you very much for your time and attention
    Levy's Fine Jewelry- buyers and sellers of modern, antique, and estate jewelry

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,886
    Mentioned
    208 Post(s)
    Tagged
    12 Thread(s)
    Hey Joseph,

    Do you have a link to the site you are trying this on?

  5. #5
    SitePoint Mentor silver trophybronze trophy
    alabamaseo's Avatar
    Join Date
    Dec 2012
    Location
    Birmingham, AL
    Posts
    203
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    Hey Pullo,

    The site is http://TruckerMarketplace.com. The password is "driver88". Thanks for helping me look into it.
    Levy's Fine Jewelry- buyers and sellers of modern, antique, and estate jewelry

  6. #6
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,886
    Mentioned
    208 Post(s)
    Tagged
    12 Thread(s)
    No probs

    If you look at the main page in the console, you see:

    Code:
    Uncaught SyntaxError: Unexpected token > truckermarketplace.com/:174
    This seems to be caused by this:

    Code:
    ts.toHTML() => "..."
    Try changing it to:

    Code:
    ts.toHTML() = "..."
    I've got to turn in now (I'm ill), but if that doesn't work, post back here and I'll check back tomorrow.

  7. #7
    SitePoint Mentor silver trophybronze trophy
    alabamaseo's Avatar
    Join Date
    Dec 2012
    Location
    Birmingham, AL
    Posts
    203
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    Still having the same problems Nothing is showing up at all.

    I hope you feel better Pullo.
    Levy's Fine Jewelry- buyers and sellers of modern, antique, and estate jewelry

  8. #8
    SitePoint Mentor silver trophybronze trophy
    alabamaseo's Avatar
    Join Date
    Dec 2012
    Location
    Birmingham, AL
    Posts
    203
    Mentioned
    25 Post(s)
    Tagged
    0 Thread(s)
    I was able to make a plugin work for what I needed.

    I hope you feel better.
    Levy's Fine Jewelry- buyers and sellers of modern, antique, and estate jewelry

  9. #9
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,886
    Mentioned
    208 Post(s)
    Tagged
    12 Thread(s)
    Hey, that's cool.
    I was just looking at this now, so thanks for letting me know.

    What was the problem?

    Quote Originally Posted by alabamaseo View Post
    I hope you feel better.
    Yeah, a bit better thanks - it is just a cold, so if I sleep more and spend less time at the PC then it should be fine.
    Although, that might be easier said that done ...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •