Call hook_onload() in all modules to enable modules to insert JavaScript that will get run once the page has been loaded by the browser.

Parameters

$theme_onloads: Additional onload directives.

Return value

A string containing the onload attributes.

Related topics

2 calls to theme_onload_attribute()
chameleon_page in themes/chameleon/chameleon.theme
xtemplate_page in themes/engines/xtemplate/xtemplate.engine
1 theme call to theme_onload_attribute()
theme_page in includes/theme.inc
Return an entire Drupal page displaying the supplied content.

File

includes/theme.inc, line 839
The theme system, which controls the output of Drupal.

Code

function theme_onload_attribute($theme_onloads = array()) {
  if (!is_array($theme_onloads)) {
    $theme_onloads = array(
      $theme_onloads,
    );
  }

  // Merge theme onloads (javascript rollovers, image preloads, etc.)
  // with module onloads (htmlarea, etc.)
  $onloads = array_merge(module_invoke_all('onload'), $theme_onloads);
  if (count($onloads)) {
    return ' onload="' . implode('; ', $onloads) . '"';
  }
  return '';
}