Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I tried the solution that was marked "correct" and it did not work. I sent an email to the author of the Countdown plug-in and his response is below. I implemented his response in my solution and it worked perfectly! Here is the correct way to do it:</p> <hr> <p>You can pass extra parameters via an anonymous function. Something like this:</p> <pre><code>$('#countdown').countdown({until: +300, onExpiry: function() { myFunction(createdTime, searchText, updateDestination); }}); </code></pre> <p>Cheers</p> <p>Keith</p> <hr> <p>By the way, here is the working code from my application:</p> <pre><code>function MakeTimer(timerNode, displayNode, searchTerm){ // get the duration of the timer var duration = Number( $("#refreshTimer").val() ); // create a new property and/or set property to creation time timerNode.prop('createdTime', new Date()); timerNode.prop('searchTerm', searchTerm); //assumes that timerNode is a jQuery node and duration is an int //timerNode.countdown({until: duration, format: "s", compact: true, onExpiry: resetTimer}); timerNode.countdown({until: duration, format: "s", compact: true, onExpiry: function() { resetTimer(timerNode, displayNode); }}); // get twitter data getTwitterData(timerNode, displayNode); } function resetTimer(timerNode, displayNode){ // get the current duration of the timer var duration = Number( $("#refreshTimer").val() ); timerNode.countdown('change','until', duration); // get updated twitter data getTwitterData(timerNode, displayNode); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload