Skip to content

Instantly share code, notes, and snippets.

Last active February 18, 2019 22:14
What would you like to do?
Simple JS code for adding links to all headers on a Confluence page
javascript:AJS.$("[id]").filter(":header").each(function(){$(this).prepend("<a href='#"+$(this).attr("id")+"'>#</a>")})
<script type="text/javascript">
//prepend each header with a link to the header that can be used for ease of deep linking
try {
$(this).prepend("<a href='#" + $(this).attr("id") + "'>#</a>");
} catch(e) { console.log(e) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment