modX.regClientStartupScript
Last updated Nov 27th, 2019 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$306 per month—let's make that $500!
Learn moremodX::regClientStartupScript¶
Register JavaScript to be injected inside the HEAD tag of a resource.
Syntax¶
API Doc: modX::regClientStartupScript()
void regClientStartupScript (string $src, [boolean $plaintext = false])
Example¶
Register some JS to the start of the page:
$modx->regClientStartupScript('assets/js/onload.js');
$modx->regClientStartupScript('//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"');
$modx->regClientStartupScript('http://code.jquery.com/jquery-latest.min.js');
See Also¶
- modX
- modX.regClientCSS
- modX.regClientHTMLBlock
- modX.regClientScript
- modX.regClientStartupHTMLBlock
- modX.getRegisteredClientScripts
- modX.getRegisteredClientStartupScripts
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$306 per month—let's make that $500!
Learn more