Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6648795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:41:51+00:00 2026-05-26T00:41:51+00:00

So I’m using http://keith-wood.name/countdown.html to do a countdown and am trying to figure out

  • 0

So I’m using http://keith-wood.name/countdown.html to do a countdown and am trying to figure out how to pass some params to the callback function that can be set in the plugins’ options:

 var param = 5;    
 initCount(param);

 function initCount(param) {
     $('selector').countdown({
       onExpiry:
       function endCount(param) {
         alert(param);
       }
     });
 }

I took a look at the full version of jquery.countdown.js and found the developer literally saying this on Line 47 and Line 48: “// receives no parameters and ‘this’ is the containing division” Well, that’s not good enough for me. Applying his options, he uses the following code: (Line 209)

var onExpiry = this._get(inst, ‘onExpiry’);
if (onExpiry) {
onExpiry.apply(target, []);
}

So…. What would be the best way to change:

onExpiry.apply(target, [])

So that I could pass my params if needed in the options as proposed above?

Thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:41:52+00:00Added an answer on May 26, 2026 at 12:41 am

    i have encoutered the very same probleme , thanks god i just found a round about solution here it is :
    you have to add a new parameter to the signature of options in Jquery.countdown.js :

    this._defaults = {
            until: null, // new Date(year, mth - 1, day, hr, min, sec) - date/time to count down to
                // or numeric for seconds offset, or string for unit offset(s):
                // 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
            since: null, // new Date(year, mth - 1, day, hr, min, sec) - date/time to count up from
                // or numeric for seconds offset, or string for unit offset(s):
                // 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
            timezone: null, // The timezone (hours or minutes from GMT) for the target times,
                // or null for client local
            serverSync: null, // A function to retrieve the current server time for synchronisation
            format: 'dHMS', // Format for display - upper case for always, lower case only if non-zero,
                // 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
            layout: '', // Build your own layout for the countdown
            compact: false, // True to display in a compact format, false for an expanded one
            significant: 0, // The number of periods with values to show, zero for all
            description: '', // The description displayed for the countdown
            expiryUrl: '', // A URL to load upon expiry, replacing the current page
            expiryText: '', // Text to display upon expiry, replacing the countdown
            alwaysExpire: true, // True to trigger onExpiry even if never counted down
            onExpiry: null, // Callback when the countdown expires -
                // receives no parameters and 'this' is the containing division
            onTick: null, // Callback when the countdown is updated -
                // receives int[7] being the breakdown by period (based on format)
                // and 'this' is the containing division
            tickInterval: 1 ,// Interval (seconds) between onTick callbacks
            identifier:''
        };
    

    then you should add your identifier the call of the function

    if (onExpiry) {
                        onExpiry.apply(target,[this._get(inst, 'identifier')]);
                    }
    

    then the call to your UpdateCountdown will look like this

    $('#defaultCountdown).countdown({identifier:1,onExpiry: yourFuncion, until: new Date('2012-01-04')});
    

    your function will look like this one :

    function yourFunction(id){
    alert(id);
    }
    

    you can potentialy turn alwaysExpire on the Jquery.countdown.js to true , so you can test pre-expired dates .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have thousands of HTML files to process using Groovy/Java and I need to
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.