Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Requirements::Javascript problem

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1796 Views
  • hitautodestruct
    Avatar
    Community Member
    19 Posts

    Requirements::Javascript problem Link to this post

    Sorry anyone who managed to take a look at this post in the last 15 minutes but it was a stupid mistake. I didn't realize where SilverStripe picks up the root from so my mistake was adding a slash at the front of the path.
    Hope this helpes anyone who's run into something as small as this.

    {Fixed}

    Hello,
    I've been trying to include javascript files using the Requirements class with no luck.
    The css include works great but not the javascript.
    Can anyone tell me if there is a switch or something I have to do so the javascript will be included in the php controller page.
    Heres my include code:

       function init(){
          parent::init();
          Requirements::JavaScript('/mysite/javascript/jquery.js');
          Requirements::JavaScript('/mysite/javascript/jquery.curvycorners.js');
       }

    1796 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.