Hi, I just started testing using javascript for my confluence page. This is the simple test java script im using
I have the following WML on my confluence page
But, when i execute it, i dont get the required "New Header" as result. I get the same "Old header" text on my page. But, other commands like a simple document.write() works. It doesnt give me the required result when im trying to access a particular part of the body using divs. I dont know what i am doing wrong. Any solutions?? Plz help.... I am working on a standalone version of confluence 3.5.9.
Thanks, Avinash
|
You can add AJS.toInit(function() { to wrap your code:
<script> AJS.toInit(function() { var element=document.getElementById("header"); element.innerHTML="New Header"; }); </script>
Since the top navigation bar is placed inside an element with ID "header", the top navigation bar is replaced instead of the one created in your Confluence page
It works partially. I get the "new header" displayed but it doesnt replace the "old header"...it renders it at thetop left of the confluence window. How do i get it to replace the old header with the new header text?
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.