CQ.Util.formatData(CQ.Util.eval('/apps/
Unable to read json file using CQ.Util.formatData(CQ.Util.eval('/apps/ax.json') in 6.4.IT is working in other instance.Any js files need to be installed or any config changes needed
Unable to read json file using CQ.Util.formatData(CQ.Util.eval('/apps/ax.json') in 6.4.IT is working in other instance.Any js files need to be installed or any config changes needed
Hi,
There might be missing clientlibs required for those functions to work. In any case, is there anything preventing you from using vanilla JS to achieve the same result? Using vanilla JS is preferable, so something like this should work:
fetch('/apps/ax.json')
.then(response => response.json())
.then(data => {
//TODO: You can write your own "formData" function to parse the date in any format
const formattedData = formatData(data);
console.log(formattedData);
})
.catch(error => {
console.error('Error:', error);
});
//TODO
function formatData(data) {
...
return data;
}
Hope this helps
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.