theme_onload_attribute

Versions
4.6
theme_onload_attribute($theme_onloads = array())

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

Code

includes/theme.inc, line 839

<?php
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 '';
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.