modX::regClientStartupScript
Register JavaScript to be injected inside the HEAD tag of a resource.
Syntax
API Doc: http://api.modxcms.com/modx/modX.html#regClientStartupScript
void regClientStartupScript (string $src, [boolean $plaintext = false])
Example
Register some JS to the start of the page:
$modx->regClientStartupScript('assets/js/onload.js');