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   1112 Views

Avatar
suntrop

Community Member, 131 Posts

31 May 2010 at 11:05pm

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

Community Member, 63 Posts

1 June 2010 at 3:05am

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

Community Member, 131 Posts

1 June 2010 at 10:26pm

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

Avatar
Bruce B

Community Member, 147 Posts

3 June 2010 at 7:53pm

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