I'm trying to create an HTML helper extension that generates some javascript in addition to an HTML tag:
<select id="foo" name="foo"></select>
<script type="text/javascript">
// script to populate select with data via $.getJSON
</script>
In the default MVC 4 template, they bundle the jquery scripts and put them at the end of the HTML document and have a scripts section:
@Scripts.Render("~/bundles/jquery")
@RenderSection("scripts", required: false)
Is there any way in an HTML helper extension to tell the script to get added to the end of the document, or do I just need to modify the Layout so that jQuery is at the top of the document?