JSON encoding problem in IE6 and IE7 <p>Can someone tell me how to change this <code>getJSON</code> request to a <code>.ajax</code> call so I can set the <code>contentType</code> option?</p> <pre><code>$.getJSON('json/showreel.json', function(data) { //get total number of JSON objects and generate random numder var total = data.length; var randnum = Math.floor(Math.random()*total) //Loop through each of the JSON objects to check if matches random number $.each(data, function(entryIndex, entry) { if(entryIndex === randnum){ var info = '&lt;div class="entry" style="color:' + entry['colour'] + '"&gt;'; info += entry['title'] + '&lt;br /&gt;'; info += '&lt;a href="' + entry['link_url'] + '"&gt;' + entry['website'] + '&lt;/a&gt;'; info += '&lt;/div&gt;'; $('#head-contact,#head-contact a').css('color',entry['colour']); //create new image object to preload image var img = new Image(); //once image has loaded execute this code $(img).load(function () { //$(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already $(this).hide(); $('#showreel').removeClass('loading').append(this); $(this).fadeIn(3000); }).error(function () { // notify the user that the image could not be loaded }).attr('src', entry['image_src']); } $('#info').append(info); }); }); </code></pre> <p>Many thanks, C</p>