[jQuery] JSON $Get.Json Silently Failing
hello,
i have rather frustrating problem with $get.Json silently failing; i
have a data set that return; but many that fail. after i try and
serialize the data and send it back to the client; it never return and
the function $get.Json fails to return
if i place the JSON serialized objects in an data file and call
$get.Json..everything works. but not from the response.write on the
fly.
is there a way to format the json serialzed return? is there any
subtle characters in the json string that could prevent this from
occuring? ie. escape, /backslash etc.
any help is greatly appriecated!
//page.aspx (Fails to return to $Get.JSON
JavaScriptSerializer jss = new JavaScriptSerializer();
Response.Write(jss.Serialize(data));
//test.js
function testForm() {
alert("before");
$.getJSON("../json/test.aspx", function(data,textStatus){
//$.getJSON("../jsondata/data_Success.js", function(data,textStatus)
{
alert(textStatus);
result = data.Result;
});
alert("after");
}
//Json object - can anyone see anything wrong with this?
{"AvailableSlots":2,"BookedPlayers":2,"MaxPlayers":4,"StartingHole":
1,"ExtensionData":{},"Comments":"Time Extract
Successful!","Reason":"Time Extract Successful!","Result":0}