0

I had this error on internet explorer 'JSON' is undefined.

The error occurred here:

ajaxCall({
    url: me.getAllService,
    data: JSON.stringify(unionParameters({ filter: filter }, getData(), me.getAllParameters)),
    success: function (result) {
        if (typeof (onSuccess) == 'function')
            onSuccess(result);
    },
    error: function (error) {
        if (typeof (onFailed) == 'function')
            onFailed(error);
    }
});
Matthew
  • 24,703
  • 9
  • 76
  • 110
  • Do you know if the version of internet explorer you're using supports the object `JSON`? – Matthew Nov 02 '14 at 04:51
  • possible duplicate of ['JSON' is undefined error in IE only](http://stackoverflow.com/questions/5093582/json-is-undefined-error-in-ie-only) – Ram Nov 02 '14 at 04:58

3 Answers3

0

The JSON parsing features appeared in IE8. If you are using IE7 or earlier, JSON will be undefined.

Additionally, if you are using IE8, it must be in standards mode. In quirks mode, the JSON formatter will not be available.

In any event, there are polyfills available so that you can use the JSON formatter in those situations. Scroll down to "JavaScript" at http://www.json.org/ for four possibilities.

Sources/additional information:

Trott
  • 66,479
  • 23
  • 173
  • 212
0

use JSON2. It is the polyfill you need

http://cdnjs.com/libraries/json2

code_monk
  • 9,451
  • 2
  • 42
  • 41
0

I solved this problem by adding this lines of code in master page :

<meta http-equiv="X-UA-Compatible" content="IE=9" />