The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

HTML problem in display

Colm Maguire
Contributor
June 2, 2022

So I am using the HTML Macro at the bottom of my page and inserting the following code into the created HTML box. When I preview the page it looks great, but when I save it, all I see is the time stamp. My page content disappears Clearly I am doing something wrong but can anyone help me out? 

 
<!DOCTYPE html>
<html>
<body>

<h1>Time of Last Edit</h1>
<h2></h2>

<p>This document was last modified:</p>
<p id="demo"></p>

<script>
let text = document.lastModified;
document.getElementById("demo").innerHTML = text;
</script>

</body>
</html>

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
June 2, 2022

Hi @Colm Maguire 

What do you want to achieve? 

Because, "document.lastModified" will not get you the last modification date of the page. It will get you the last modification date of the "HTML document type", not the document from confluence. You can use this javascript in any other page or even in the console of your browser. 

If you want to get the date of the latest modification of the confluence page, then you need to write a user macro:

Regards, Dominic

Colm Maguire
Contributor
June 3, 2022

Oh dear me. Okay thank you for that. I guess I am gonna have to learn :D 

Like Dominic Lagger likes this
TAGS
AUG Leaders

Atlassian Community Events