how to add a js file to batch.js in confluence 4.2?????

Hi, I have seen a folder where there's too many js files with distinct functions, but in the google chrome developer tool it's loaded only One file, batch.js, inside this there are all the js scripts in include/js folder.


1 answer

My understanding, and this a guess at best, is that batch.js is compiled (by that I mean compounded, not actually compiled) on the back-end and served up by the confluence web app. It includes more than just the scripts in the JS folder, but lots of JavaScript fragments. There's also a batch.css file that does a similar thing for style properties that are all over the place.

One reason they might do this is because the version of batch.css and batch.js that get transmitted appear to be optimized (whitespace stripped out). So it gives you the opportunity to view the sources of the batch files on the server in un-optimized format, but then saves bandwidth by transferring them as optimized.

I don't think you can insert anything into the batch files without touching server side code (and recompiling the web app. If you want to include a JS file, add a <script> to your Custom HTML in the Administration panel.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

58 views 3 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you