hook_onload

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()

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