Question

My sender function:

var parseData = JSON.stringify(requestData);
        iframe[0].contentWindow.postMessage({ request: parseData, request_id: dataOrign.length - 1 }, '*');

and function of receiving a request:

$(window).on("message", function(e) {
        var requestData = JSON.parse(e.originalEvent.data.request);
    }

in IE 9 I have this error:

0x800a03f6 - JavaScript runtime error: Invalid character in:

var requestData = JSON.parse(e.originalEvent.data.request);

In other browsers everything works fine. tell me what the problem is and how to solve it?

Was it helpful?

Solution

Are you using IIS? If so, open IIS and look at your MIME types. Check to see if you have one called .json. If not, simply add one called .json and set it to application/json.

Hope it helps :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top