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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Dont't want to load useless JS files


Go to End


4 Posts   1532 Views

Avatar
suntrop

Community Member, 141 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, 141 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, 164 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');