Hi,
I'm running a JS Script on Confluence adding a HTML content to modify some tables and it's working good, But I would like to run that script even when the users are editing the Confluence Page, is there a way to run the scripts on the edit view?
If yes, can you provide the documentation
Thanks
If you apply the JS to the Custom HTML section, then it will show up on every page, regardless of whether you are in view or edit mode:
https://confluence.atlassian.com/confkb/how-to-use-javascript-in-confluence-313458839.html
Hi Stephen Deutsch,
Thanks for your answer I tried to run the script from "Custom HTML section" and I got to run the script on other views of Confluence but not on the edit view.
Any other suggestion?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I figured out how to run JavaScript only while editing a page, but it's a dirty solution I would say.
You have to edit the page layout file (page.vmd).
There you just can insert a code block like this:
#if ($mode == "edit")
<script>
DO JS STUFF
</script>
#end
But you can't use jQuery here (I don't know why...), only pure JavaScript.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.