Not sure what’s cominded.env ?
To load data you would need to call your API and in call back need to populate the data using dom manipulation. For example see how it’s done using axios simple example
axios.get("url").then((response) => {
let data = response.data;
for (let i = 0; i < data.length; i++) {
$("#data-div").append(
`<tr>
<td>
<div class="name"><span>${data[i].name}</span> :
<span class="date" style="float:right">${data[i].created_date}</span></div>
</td>
</tr>`
);
}
});
Thanks for the response. The combined.env is inside all.js and all-debug.js not sure why its undefined thou.
I am using .NET MVC and JQuery. I am getting a HTML result from API which I am trying to load inside the iframe. I tried to download the all.js from my end and tried to remove the error by adding some checking script Something like this:
if (combined.env) {
combined.env.hideFooter(consumerOptions.get('hideFooter') === true);
}
and that do the trick for now. I am planning to retrieve all.js from connect-cdn later.
we dont have a “cgraphq” controller somewhere in my code. Do I need to install anything to get a wiki from Confluence? This is how I’m consuming the API:
using (var request = new HttpRequestMessage(new HttpMethod(“GET”), “https://test.atlassian.net/wiki/test/testURL”))
{
try
{
var base64authorization = Convert.ToBase64String(Encoding.ASCII.GetBytes(“username:token”));
request.Headers.TryAddWithoutValidation(“Authorization”, $“Basic {base64authorization}”);
var response = await httpClient.SendAsync(request);
//response = httpClient.SendAsync(request);
//uri = response.RequestMessage.RequestUri; //.Headers.Location;
if (response.IsSuccessStatusCode)
{
using (HttpContent content = response.Content)
{
System.Threading.Tasks.Task<string> s = content.ReadAsStringAsync();
result = s.Result;
//result = "<html><body><div>HELLO WORLD</div></body></html>";
ViewBag.HelpContent = HttpUtility.HtmlEncode(result);
}
}
}
catch (Exception e)
{
}
}
}
I think this is being loaded internally by confluence, it would be tricky to do what you are trying as all relative resources will fail to load. IMHO better approach would be look at Confluence REST APIs and use them instead try to load the page directly in iframe.
I actually tried the samples and guides from Confluence Server REST API and I’m getting a HTML result. Tested it using postman and I got same result. Now I’m in dead end when I’m trying to load the HTML result in iframe. There are no .NET sample from Confluence documentation, that’s why I’m trying to find a work around to make it work using .NET and JQuery. Things are getting complicated. Been trying to figure it out for a week now.