21293 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1440 Views |
-
Javascript doesn't show up. Why?

7 November 2009 at 12:54pm
This is what I'm writing in Page.php Controller:
public function init() {
parent::init();
Requirements::JavaScript('/mysite/javascript/jquery.js');
Requirements::JavaScript('/mysite/javascript/dropdownmenu.js');
}But my page doesn't show my scripts. What is wrong?
It doesn't work in FF and it doen't in IE... I tried to put this line "ContentNegotiator::disable();" in _config.php - doesn't work eather. -
Re: Javascript doesn't show up. Why?

7 November 2009 at 1:14pm
Requirements::JavaScript('/mysite/javascript/jquery.js');
Should be
Requirements::javascript('mysite/javascript/jquery.js');
Note the lower case 'javascript' and mysite usually shouldn't have a / in front of it
-
Re: Javascript doesn't show up. Why?

15 June 2010 at 2:04am Last edited: 16 June 2010 2:12am
Hi, Im new to SilverStripe and have just run thru the first tutorials, when I tryed to implement the image gallery everything worked fine but thats when I discovered that the javascript wont show in the head section. Can I have messed up some other file? dont have a clue about this. ive tryed different paths, nothing seems to get the javascript to show up in the <head> section. The css loads but not the javascript im really clueles?!
somehow I got the gallery javascript working but when I try to add new javascript to HomePage I cant????
| 1440 Views | ||
|
Page:
1
|
Go to Top |



