سؤال

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