Forums

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

How to render the content of a Confluence page including the Confluence page CSS and Javascript ?

Manu Sam
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 23, 2013

Hello,

Im trying to get the contents of the Confluence page to another site using the JSON-RPC renderContent method. The below code return me most of the contents but some javascript functions are missing and CSS so some Confluence plugins are not working (Expand macro,Info macro).

Do you know how to fix this? Or is there another method to load the Confluence javascript and CSS ?

Also we did notice a character "�" getting displayed when the html code has an empty paragraph

' <p> </p>' . Do you also know why this occurs ?

Is this an encoding issue ? I checked my Confluence configuration and the Encoding s set to UTF-8.

Below is the code to call "renderContent" method

$.ajax({
			type: "POST",
			url: "http://samplehost.net/confluence/rpc/json-rpc/confluenceservice-v2/renderContent",
			data: ' [ "AIPAS", 32538632, "" ] ',
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			success: function(data){
				$("#mydiv").html(data);
			},
			failure: function(errMsg){
				alert(errMsg);
			}
		});

2 answers

0 votes
Jonathan Simonoff
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 Leaders.
December 30, 2013

I think you might be better off just doing a regular fetch of the page -- use the actual page URL:

jQuery.ajax({
    url : "/display/${space}/${mypage}?decorator=printable",
    success : function(result){
        do something with the result;
    }
  });

0 votes
Max Soldatjonok
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 3, 2013

I have the same problem. I can not solve it.

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, confluence, loom, atlassian intelligence, ai notes, ai-powered meeting notes, atlassian community events, ace, confluence ai, loom ai integration, ai note-taking, atlassian ai features, team '25, atlassian live learning, confluence automation

Unlock AI-powered meeting notes: Join our live learning session! 📹

Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.

Register today!
AUG Leaders

Atlassian Community Events