You are here

function js_preprocess_html in JS Callback Handler 7.2

Implements hook_preprocess_html().

Provide necessary JS functionality so modules can generate easier requests.

File

./js.module, line 92
JavaScript callback handler module.

Code

function js_preprocess_html() {

  // Add any unique tokens created to the current page request. This is to help
  // ensure valid JS requests. Note, this only adds tokens that were generated
  // on this page request. It does not provide tokens for all callbacks.
  drupal_add_js(array(
    'js' => array(
      'tokens' => js_get_token(),
    ),
  ), 'setting');
}