How do I build in some JavaScript into my Confluence page?

Hello, I'd like to know if it's possible to build in a JS script into my confluence page. 

I have a 'Run macro' script and it's got a field "Date", it expects a date in this format: DD/mm/YYYY


I wonder how do I embed a JS script so that I don't have to type that date. I'd like to see a small calendar and pick a date by a mouse click. 


Any ideas? my_form.png

2 answers


you said you hava a macro, so what you need is to add a web resource to your plugin ->

There you can use the context-mechanism to load the js file dedicated to your macro.


If it's a user macro and you maintain it via the admin console (which I would not recommend), you can just add a script tag to your markup or if you need a library, try a cdn.




1 vote
Davin Studer Community Champion Feb 24, 2015

You can insert javascript on the page using the html macro.

Davin Studer Community Champion Feb 24, 2015

By the way it is not enabled by default. You have to enable it manually.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,909 views 27 12
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