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
Published Tuesday in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

211 views 2 10
Read article

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