문제

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