You are here

function ajax_poll_init in AJAX Poll 6

Implements hook_init().

File

./ajax_poll.module, line 31
Enables voting on polls without reloading the page.

Code

function ajax_poll_init() {

  // It would be ideal to not load this JavaScript on every page. However since
  // block caching will not add the necessary files if block caching is enabled,
  // we have to add these files on every page.
  if (variable_get('block_cache', 0)) {
    drupal_add_js('misc/jquery.form.js');
    drupal_add_js(drupal_get_path('module', 'ajax_poll') . '/ajax_poll.js');
  }
}