0

I'm having an issue with JSON serialization in IE11 when doing either appAP.JSON.stringify() or the regular JSON.stringify() method. It appears to work correctly always under Chrome.

The issue that i'm getting is fairly basic, the following code

var x = ["x", "b"]; alert(JSON.stringify(x));

Will yield incorrect json under IE 11 while running the crossrider extension.js, result will be {"0":"x","1":"b"}

Where the expected result should be ["x","b"]. I get this (correct) result always in Chrome, and I get this result in IE if its code running directly on the page.

This is causing me grief because my JSON deserializer this is sent to is unable to convert the object to an array.

Any thoughts why crossrider stringify() calls would serialize different to native IE ?

dfeuer
  • 48,079
  • 5
  • 63
  • 167
mrwayne
  • 627
  • 6
  • 15
  • Couple of quick questions: (1) Which version of Windows are you experiencing this problem on? (2) Does it happen in IE10/9 as well? [**Disclosure**: I am a Crossrider employee] – Shlomo Feb 16 '15 at 18:18
  • Confirmed the problem in IE11 on Windows 7 and on IE10 running Windows 8 – mrwayne Feb 19 '15 at 00:37

1 Answers1

1

Problem was due to the use of JSON.stringify() instead of appAPI.JSON.stringify()

Make note that use of jquerys $.ajax style functions use JSON.stringify and as such will fail.

Issue was confirmed by Crossrider that IE would not serialize the same as Chrome (that is - correctly).

mrwayne
  • 627
  • 6
  • 15