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?

有帮助吗?

解决方案

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 :)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top