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

Dont't want to load useless JS files


Reply

4 Posts   1076 Views

Avatar
suntrop

31 May 2010 at 11:05pm Community Member, 131 Posts

SS loads a bunch of JS files at the end of my pages (Prototype, behaviour.js, i18n.js ...).

But I really don't need them on my page. It just cranks up download time for users. Where do I fix that?

Avatar
patte

1 June 2010 at 3:05am Community Member, 63 Posts

In Page_Controller I use this for excluding prototype and thirdparty scripts, like userforms

   public function init() {
      parent::init();
      Requirements::block('sapphire/thirdparty/jquery/jquery.js');
      Requirements::block('userforms/thirdparty/jquery-validate/jquery.validate.min.js');
      Validator::set_javascript_validation_handler('none');
   }

Avatar
suntrop

1 June 2010 at 10:26pm Community Member, 131 Posts

patte, thanks for your help. You saved my users a lot of traffic :)

Avatar
Bruce B

3 June 2010 at 7:53pm Community Member, 145 Posts

The search field wants to load lost of validation js. You can kill those in your _config file with the following line:

Validator::set_javascript_validation_handler('none');