Web Development & Execution
Justin Colangelo
by Justin Colangelo
share this
?fl
« Back to the Blog

Internet Explorer 9 and data.responseJSON

10/17/2014

On a recent monster form, we have two pages. One of the pages submits most of the information, and second page submits the rest. We save the first page in the database and return the formId of the new database row. This is how we update the record based on the data in page two.

We were using:

$($form).ajaxSubmit({
                complete: function (data) {
                    common.hideAjaxLoader($container);
                    // Store the id
                    self.jobFormId = data.responseJSON.formId;
                }
            });

Apparently this doesn’t work in Ineternet Explorer 9 and under. The data.responseJSON was missing from the returned data. All other browsers and newer IE don’t seem to mind using that. To fix the 'glitch' (Office Space) we had to use something like this:

var dat = JSON.parse(data.responseText);
self.jobFormId = dat.formId;

You may run into this issue again since IE9 still needs to be supported. We use ajax responses for a lot of things.

Another issue we ran into was the fact that IE9 and under thinks that JSON responses are downloadable files sometimes. This was happening to us because the return type on the form save action in C# was ActionResult. The headers were being returned different than we wanted. We changed it back to JsonResult and haven't had any issues since.

Hope this post helps.

Thanks!

Thank you for contacting us!

We'll be in touch!

Back Home ×