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 scriptaculous in SS


Reply

3 Posts   1668 Views

Avatar
ss_freebie

4 July 2009 at 12:37pm Community Member, 6 Posts

Hi there,

I am very new to SS. I want to include prototype and scriptaculous in the fornt end, what I have done is followings:

Page.php:

public function init() {
      parent::init();

      Requirements::themedCSS("layout");
      Requirements::themedCSS("typography");
      Requirements::themedCSS("form");
      Requirements::javascript("jsparty/prototype.js");
      Requirements::javascript("jsparty/prototype15.js");
Requirements::javascript("jsparty/prototype_improvements.js");
Requirements::javascript("jsparty/prototype-safe.js");
Requirements::javascript("jsparty/scriptaculous/scriptaculous.js"); //this line seems not include scriptaculous.js
      
   
   }

The prototype is included and working FINE but not the scriptaculous to me but I am not sure since once I used the effect.fade() or draggable, the
Object cannot be created in this context" code: "9
occurs, I have raised this problem in my previous post.

So I would like to check with your guys, did I do the right thing to include prototype and scriptaculous ? Pls advise...
Thanks heaps :)

Avatar
marcusl

5 July 2009 at 11:48am Community Member, 1 Post

Hei guys,

I am a newbie to SS too, tried to use script.aculo.us but not sure how to include it in the front end as well. Any one can help here ?
thanks:)

Avatar
ss_freebie

5 July 2009 at 12:41pm Community Member, 6 Posts

i have included the following prototype library in page.php:

Requirements::javascript("jsparty/prototype.js");
Requirements::javascript("jsparty/prototype15.js");
Requirements::javascript("jsparty/prototype_improvements.js");
Requirements::javascript("jsparty/prototype-safe.js");

i can use prototype library on the front end without problems, but as soon as i add this line for scriptaculous:

Requirements::javascript("jsparty/scriptaculous/scriptaculous.js");

on the front end i got the same javascript error from fire bug as mentioned above:
Object cannot be created in this context" code: "9

have i done something wrong ? any advices for utilising scriptacolous correctly ?

thanks:)