$.ajax call error in IE but not FireFox
<p>I am trying out $.ajax instead of getJSON for debugging purposes.  Because getJSON did not report an error in IE (6,7 or 8) and I am trying to figure out why a jQuery plug-in is not painting my returned images to the screen in IE but is in other browsers.</p>

<p>So I tried this.  Interestingly enough, it hits the error event in IE but not firefox, safari and the rest and I don't know why <strong>(this code works great and renders my data just fine in FireFox and the rest)</strong>.  I know my returned json is valid:</p>

<pre><code>$.ajax({
    type: "GET",
    url: "http://localhost:59396/sss/sssHandler.ashx?action=getproducts&amp;ids=" + ids,
    data: "{}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(data) {
        alert(data.length);
        carousel.size(allProductIDs.length);

        if (numberOfImagesLeftToShow &lt; numberOfImagesToDisplay) {
            first += (numberOfImagesToDisplay - numberOfImagesLeftToShow);
        }

        var d = 0;
        for (var i = first; i &lt;= last; i++) {

            if (d != undefined) {
                // add data using index of the array returned by JSON (which starts at 0)
                carousel.add(i, decode(data[d].ImageTag));
            }

            // set to last ProductID showing in Carousel
            if (i == last) { lastProductID = parseFloat(data[d].ProductID); }

            d++;
        }
    },

    error: function() {
        alert("An error has occurred. Please try again.");
    }
});
</code></pre>

<p>I don't know what else to do to troubleshoot why IE is having so much trouble with the returned JSON or just executing the function(data) using either getJSON OR this.  I have set the headers not the cache also in the response.  That is not the problem.  <strong>The problem is for whatever reason, IE refuses to enter my function(data) on the response.</strong></p>

<p>Here's the returned JSON which shows valid (even checked it with <a href="http://www.jsonlint.com/" rel="nofollow">http://www.jsonlint.com/</a>):</p>

<pre><code>[
    {
        "ImageTag": "\u003cdiv class=\"CarouselItem
\"\u003e&amp;lt;p&amp;gt;&amp;lt;img src=&amp;quot;http://www.xxx.com/image/
2568.jpg&amp;quot; alt=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/p&amp;gt;\u003cp\u003e\u003ca href=
\"Bear-10.prod\"\u003eTeddy Bear\u003c/a\u003e\u003c/p\u003e\u003cp
\u003e$20.95\u003c/p\u003e\u003cdiv\u003e",
        "ProductID": "540"
    },
    {
        "ImageTag": "\u003cdiv class=\"CarouselItem
\"\u003e&amp;lt;p&amp;gt;&amp;lt;img src=&amp;quot;http://www.xxx.com/image/
50.jpg&amp;quot; alt=&amp;quot;&amp;quot;&amp;gt;&amp;lt;/p&amp;gt;\u003cp\u003e\u003ca href=
\"Pendant362.prod\"\u003eBirthday\u003csup\u003eÂ©\u003c/sup
\u003Necklace\u003c/a\u003e\u003c/p\u003e\u003cp\u003e$36.95\u003c/p
\u003e\u003cdiv\u003e",
        "ProductID": "83"
    }
]
</code></pre>

<p>in my .ashx I simply have the following main code to product the response</p>

<pre><code>        context.Response.ContentType = "application/json";
        context.Response.Charset = Encoding.UTF8.ToString();
        context.Response.Cache.SetNoStore();
        context.Response.Cache.SetExpires(DateTime.MinValue);
        context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        context.Response.Cache.SetValidUntilExpires(false);

        context.Response.Expires = -1;
        context.Response.ExpiresAbsolute = DateTime.MinValue;
        context.Response.AddHeader("Cache-Control", "no-cache");
        context.Response.AddHeader("Cache-Control", "post-check=0, pre-check=0");
        context.Response.AddHeader("Pragma", "no-cache");

...

string jsonString = imageList.ToJSON(); &lt;-- uses the .NET 3.5 JavaScriptSerializer
        context.Response.Write(jsonString);
</code></pre>

<p>also, it doesn't seem to matter if you specify the response.ContentType as "application/json" or "text/plain" because at least I'm getting valid data in FireFox returned and parsed.</p>
