By default, SilverStripe includes all JavaScript files at the bottom of the page body. This allows you to load all other site resources before loading any JavaScript.
If you have a script tag in the layout or include a template, it moves the script to the end of the body tag.
If you do not want the script tag to be moved, you can set Requirements.write_js_to_body to false in Page_Controller init() :
class Page_Controller extends ContentController { public function init() { parent::init(); Requirements::set_write_js_to_body(false); } }
Please note that all your requirements will be included in the JavaScript files in the <head> .
3dgoo source share