I make the following JQuery(v1.5.1) Ajax call:
function testAjaxCall()
{
$.ajax(
{
url: "/Search.ashx?",
dataType: "json"
});
}
This call returns the following JSON result:
{ "objectData" : "100" }
But in IE9 it fails with the following error (it works fine in other browsers):
SCRIPT1004: Expected ';' debug.finance.com, line 1 character 16
If I remove the dataType:json parameter, the call succeeds. Any idea what is wrong? I assume my JSON is incorrect, but I passed it through a validator and it did not report any errors.
Please help!
EDIT: (more detail)
I output JSON from the server in an ASP.NET HTTP Handler as follows:
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "application/json";
context.Response.Write("{ \"objectData\" : \"100\" }");
return;
}