天天看點

IE8 MIME type application/json not found

如果:

public ContentResult GetPaper(string testId)

{

    return ControllProctector.Do1(() =>

        {

            var result = new UserPaperBll().GetTestPaper(testId, NativeHelper.LoginUser2.Id, NativeHelper.LoginUser2.OrganizationId);

            return new ContentResult

            {

                Content = new JavaScriptSerializer { MaxJsonLength = int.MaxValue }.Serialize(result),

                ContentType = "application/json"

            };

        });

}

我們會得到一些不正确的空值。需要去掉 ContentType = "application/json" 該行,然後前台将字元串轉為 JSON 對象即可。

success: function (data) {

    data = JSON.parse(data);

IE8 MIME type application/json not found

本文基于

Creative Commons Attribution 2.5 China Mainland License

釋出,歡迎轉載,演繹或用于商業目的,但是必須保留本文的署名

http://www.cnblogs.com/luminji

(包含連結)。如您有任何疑問或者授權方面的協商,請給我留言。