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.

Archive /

Our old forums are still available as a read-only archive.

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

behaviour.js conflicts with mootools.js


Go to End


4 Posts   2989 Views

Avatar
Shane Garelja

Community Member, 18 Posts

27 March 2008 at 2:59pm

behaviour.js seems to be used in front-end pages if you add $SilverStripeNavigator to your template. The problem is I'm trying to use mootools and they are conflicting...

I guess it just means I can't have the SS Navigator menu on the front-end right? Or, I don't use mootools :P

Avatar
Double-A-Ron

Community Member, 607 Posts

16 June 2008 at 1:56pm

Yes, I've noticed the same. I've had to stop behaviour loading on any pages I'm using Mootools.

I think the error is:
Behavior is not defined.

Must be a conflict or some sort, but I havn't delved deeper. It's best to avoid Mootools unless Prototype can't help you, as prototype is packaged with Silverstripe, and is totally incompatible with Mootools. (last I heard)

Aaron

Avatar
Willr

Forum Moderator, 5523 Posts

16 June 2008 at 5:58pm

Prototype is used throughout the front end of the site - page comments, login, basically anywhere theres a form!.

One of the things coming up is SS is moving to a jQuery JS library and away from prototype. I know quite a few of us in recent projects have spent some time stripping Behaviour and prototype out of the various front end components to provide us with a clean slate. Some of this work will be part of trunk soonish I guess unless its already in there!

If you are trying to use mootools you will have to dig round and round digging out the old Behavior JS as it will pop up like a weed!

Avatar
Ingo

Forum Moderator, 801 Posts

22 June 2008 at 1:51am

both mootools and prototype share the same bad practice of cluttering the global namespace in javascript (with the $ function). one of many reasons why we're moving to jquery

if you're sure you don't need behaviour.js (e.g. you don't want any clientside form validation), you can disable it by calling Requirements::block('jsparty/behaviour.js')