Hi,
I'm trying to use a JSON feed from our site, which unfortately is not formated correctly. I can clean up the feed via calling it first via the $.ajax call, but want to be able to pass this cleaned up content back to iterate over as if it was a JSON object.
$(document).ready(function()
{
// use ajax call as json supplied needs cleaning first
$.ajax({
url: 'JSON.txt',
success: function (data)
{
var i = 0;
var html = '';
var regex = /<!--.+?-->/g;
responseText = data.replace(regex,''); // clean up Jahia's dodgy JSON output
$('body').append(responseText);
}
});
});
Any ideas how to return the responseText back as a JSON object so that I can use the $.each function to parse the file?