Insert a JavaScript onload handler.
This hook enables modules to insert JavaScript into the body => onload event for every page view.
Return value
An array of JavaScript statements to call during the onload event.
The returned statements will be automatically separated by semicolons, so including them in the returned array is optional.
Related topics
1 invocation of hook_onload()
- theme_onload_attribute in includes/
theme.inc - 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.
File
- developer/
hooks/ core.php, line 700 - These are the hooks that are invoked by the Drupal core.
Code
function hook_onload() {
return array(
'my_javascript_function()',
);
}