Sri
Sri

Reputation: 1217

Reading CQ5 content using CQ.HTTP.noCaching(path+'.infinity.json');

I would like to read all the pdf titles and display links on a page.

PDFs are located at

<script>
    var path = 'content/dam/geometrixx/documents';
    var url = CQ.HTTP.noCaching(path+'.infinity.json');`
</script>

I tried above CQ JavaScript API to read the content tree but the url is evaluating to :

"http://localhost:4502/content/teleproject/en/content/dam/geometrixx/documents.infinity.json?cq_ck=1453728531902"

rather than

"http://localhost:4502/content/dam/geometrixx/documents.infinity.json"

Could some one please shed some light on this ?

Thank you, Sri

Upvotes: 0

Views: 203

Answers (1)

Thomas
Thomas

Reputation: 7118

You are using a relative path just add a '/' at the beginning of your path. The url parameter comes from the noCaching method.

<script>
    var path = '/content/dam/geometrixx/documents.infinity.json';
    var url = CQ.HTTP.noCaching(path);
</script>

Upvotes: 1

Related Questions