theme_onload_attribute($theme_onloads = array())
drupal/includes/theme.inc, line 839
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.
$theme_onloads Additional onload directives.
A string containing the onload attributes.
| Name | Description |
|---|---|
| Themeable functions | Functions that display HTML, and which can be customized by themes. |
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 '';
}