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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Requirements::Javascript problem


Go to End


2341 Views

Avatar
hitautodestruct

Community Member, 19 Posts

27 March 2008 at 4:58am

Edited: 27/03/2008 5:17am

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');
	}