Jump to:

23358 Posts in 17873 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » How to include only 1 Javascript file (ie modernizr.js) in <head>?

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

Page: 1
Go to End
Author Topic: 502 Views
  • vwd
    Avatar
    Community Member
    158 Posts

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

    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 requires inclusion in the <head> 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.

    502 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.