Closed (works as designed)
Project:
jQuery Countdown
Version:
6.x-1.7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2011 at 21:02 UTC
Updated:
30 Aug 2011 at 21:49 UTC
In the page.tpl.php template file, I have the appropriate print $scripts; call in the HEAD tag. I tried using the example code (below) at the beginning of the file, but it doesn't work, even after clearing the cache.
<?php
echo '<div class="countdown">10 seconds!</div>';
jquery_countdown_add(".countdown", array("until" => 10, "onExpiry" => "finished"));
drupal_add_js("function finished() { alert('You are done!'); }", 'inline');
?>
I looked into the Drupal.settings code in the header, and I do not see the typical jquery_countdown definitions.
Comments
Comment #1
chadhester commentedScratched my own itch. It appears that the best method (in page.tpl.php) is with the jquery_countdown_add() function. But after that, the $scripts variable still isn't updated, so before I call that in the HEAD, I update it with:
$scripts = drupal_get_js();
Because of this, I don't think that using jquery_countdown_add() function after the $scripts variable has been called is a good idea.
Comment #2
chadhester commentedclosing this, since there's a legit workaround