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.


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

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

random javascript showing up


4 Posts   1558 Views


5 June 2007 at 10:49am (Last edited: 5 June 2007 10:54am), Forum Moderator, 213 Posts

Hi Folk

I have the following random Javascript lines showing up in my page code:

<script type="text/javascript" src="jsparty/behaviour.js"></script>
<script type="text/javascript" src="jsparty/prototype.js"></script>
<script type="text/javascript" src="jsparty/scriptaculous/effects.js"></script>
<script type="text/javascript" src="cms/javascript/PageCommentInterface.js"></script>

Where do these lines come from? I dont really need all that Javascript. I never asked them to be there.... Furthermore, if they need to be there, then I would at least have the opportunity to move them up so that my own JS can come afterwards...

Any hints greatly appreciated.

Thank you



5 June 2007 at 5:57pm Forum Moderator, 5511 Posts

Im taking a guess but I would think those js's are for the commenting system (eg leaving a comment on a page if you enable that). you probably dont want to be playing around with them if you need the commenting feature.


5 June 2007 at 7:47pm Forum Moderator, 801 Posts

exactly. as soon as you include $PageComments somewhere in your template, the PageCommentInterface is automatically loaded, which requires these javascript-files.
see cms/code/sitefeatures/PageCommentInterface.php->PostCommentForm()


6 June 2007 at 9:50am Administrator, 685 Posts

The Requirements class is what facilitates this.

You can call this in your controller's init() method, or anywhere else in your code:

It will then be added to a list of include tags that are inserted just before the </head> tag.

We do this so that any piece of PHP code can demand that a particular javascript / css file be included. For example, if you make use a TreeMultiselectField, it will include the javascript required to support this.