The code is executed after all the other resources in the given disposition have been included, so you can easily stack up little fragments that set up your UI elements or perform other functions.
This is perfect for custom taglibs that need to render bits of code inline according to their attributes.
Assuming a Sitemesh layout that calls <r:layoutResources/> at the correct times, the following causes alerts to occur when head and page body load:
<meta name="layout" content="main"/>
<r:require modules="jquery-ui, blueprint"/>
window.alert('This is the end of the page!');
</r:script> <r:script disposition='head'>
window.alert('This is the head of the page!');
- disposition - Optional. The disposition name of the code. Defaults to "defer", but the alternative is "head"