Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

How to include only 1 Javascript file (ie modernizr.js) in <head>?


Reply


586 Views

Avatar
vwd

Community Member, 160 Posts

26 October 2011 at 3:52pm

Hi,

I'm wondering what is the proper way to include only 1 Javascript file in the

<head>

of the document. The file is Modernizr.js and it [url=http://www.modernizr.com/docs/#installing]requires inclusion in the <head>[/url] of the document.

I don't want to hardcode it into the template if I can avoid it, and I don't want to use

Requirements::set_write_js_to_body(false);

as I want the rest of the Javascript files to be placed at the end before

</body>

.

Under what circumstances would

Requirements::insertHeadTags(...)

be useful?

Thanks very much.
VWD.