alert blocks cross window communication in IE












0














I do have implemented a cross window communication in javascript between a parent-window and an iframe-window.



Everything works perfectly, but as soon as an alert-window gets opened on the parent-window, within a timeout:



setTimeout(function() { alert('test'); }, 100);


the communication from the iframe-window to the parent-window is blocked until I do close the alert-window.



If the alert gets opened not within a timeout, not the communication between the iframe and the window gets blocked, but only the alert itself, what would be fine for me.



Has somebody made the same experience and how could this be solved ?



My code is very simple:





  • window (parent)



    window.addEventListener('message', receiveMessageFromIFrameFunc);
    iframe.postMessage( textJson, '*');



  • iframe



    window.addEventListener('message', receiveMessageFromParentFunc);
    window.parent.postMessage( textJson, '*');



Is there a solution to get this issue solved ?



What is the main difference between alert and alert within a timeout and why does the timeout alert block the whole cross window communication ?










share|improve this question




















  • 3




    Simple, don't use alert, it not only has blocking problems like what you're experiencing, it's also very user-unfriendly. Use a proper modal instead
    – CertainPerformance
    Nov 23 at 10:07










  • Thanks, but it is not really an option, because I do implement something in a legacy system, which I cannot touch. What I could verify that the alert is only a problem, if the alert gets opened within the event-listener of the parent-window. It seems that the open alert blocks any further events from being processed.
    – Martin
    Nov 23 at 10:37


















0














I do have implemented a cross window communication in javascript between a parent-window and an iframe-window.



Everything works perfectly, but as soon as an alert-window gets opened on the parent-window, within a timeout:



setTimeout(function() { alert('test'); }, 100);


the communication from the iframe-window to the parent-window is blocked until I do close the alert-window.



If the alert gets opened not within a timeout, not the communication between the iframe and the window gets blocked, but only the alert itself, what would be fine for me.



Has somebody made the same experience and how could this be solved ?



My code is very simple:





  • window (parent)



    window.addEventListener('message', receiveMessageFromIFrameFunc);
    iframe.postMessage( textJson, '*');



  • iframe



    window.addEventListener('message', receiveMessageFromParentFunc);
    window.parent.postMessage( textJson, '*');



Is there a solution to get this issue solved ?



What is the main difference between alert and alert within a timeout and why does the timeout alert block the whole cross window communication ?










share|improve this question




















  • 3




    Simple, don't use alert, it not only has blocking problems like what you're experiencing, it's also very user-unfriendly. Use a proper modal instead
    – CertainPerformance
    Nov 23 at 10:07










  • Thanks, but it is not really an option, because I do implement something in a legacy system, which I cannot touch. What I could verify that the alert is only a problem, if the alert gets opened within the event-listener of the parent-window. It seems that the open alert blocks any further events from being processed.
    – Martin
    Nov 23 at 10:37
















0












0








0







I do have implemented a cross window communication in javascript between a parent-window and an iframe-window.



Everything works perfectly, but as soon as an alert-window gets opened on the parent-window, within a timeout:



setTimeout(function() { alert('test'); }, 100);


the communication from the iframe-window to the parent-window is blocked until I do close the alert-window.



If the alert gets opened not within a timeout, not the communication between the iframe and the window gets blocked, but only the alert itself, what would be fine for me.



Has somebody made the same experience and how could this be solved ?



My code is very simple:





  • window (parent)



    window.addEventListener('message', receiveMessageFromIFrameFunc);
    iframe.postMessage( textJson, '*');



  • iframe



    window.addEventListener('message', receiveMessageFromParentFunc);
    window.parent.postMessage( textJson, '*');



Is there a solution to get this issue solved ?



What is the main difference between alert and alert within a timeout and why does the timeout alert block the whole cross window communication ?










share|improve this question















I do have implemented a cross window communication in javascript between a parent-window and an iframe-window.



Everything works perfectly, but as soon as an alert-window gets opened on the parent-window, within a timeout:



setTimeout(function() { alert('test'); }, 100);


the communication from the iframe-window to the parent-window is blocked until I do close the alert-window.



If the alert gets opened not within a timeout, not the communication between the iframe and the window gets blocked, but only the alert itself, what would be fine for me.



Has somebody made the same experience and how could this be solved ?



My code is very simple:





  • window (parent)



    window.addEventListener('message', receiveMessageFromIFrameFunc);
    iframe.postMessage( textJson, '*');



  • iframe



    window.addEventListener('message', receiveMessageFromParentFunc);
    window.parent.postMessage( textJson, '*');



Is there a solution to get this issue solved ?



What is the main difference between alert and alert within a timeout and why does the timeout alert block the whole cross window communication ?







javascript






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 at 5:06

























asked Nov 23 at 10:06









Martin

11




11








  • 3




    Simple, don't use alert, it not only has blocking problems like what you're experiencing, it's also very user-unfriendly. Use a proper modal instead
    – CertainPerformance
    Nov 23 at 10:07










  • Thanks, but it is not really an option, because I do implement something in a legacy system, which I cannot touch. What I could verify that the alert is only a problem, if the alert gets opened within the event-listener of the parent-window. It seems that the open alert blocks any further events from being processed.
    – Martin
    Nov 23 at 10:37
















  • 3




    Simple, don't use alert, it not only has blocking problems like what you're experiencing, it's also very user-unfriendly. Use a proper modal instead
    – CertainPerformance
    Nov 23 at 10:07










  • Thanks, but it is not really an option, because I do implement something in a legacy system, which I cannot touch. What I could verify that the alert is only a problem, if the alert gets opened within the event-listener of the parent-window. It seems that the open alert blocks any further events from being processed.
    – Martin
    Nov 23 at 10:37










3




3




Simple, don't use alert, it not only has blocking problems like what you're experiencing, it's also very user-unfriendly. Use a proper modal instead
– CertainPerformance
Nov 23 at 10:07




Simple, don't use alert, it not only has blocking problems like what you're experiencing, it's also very user-unfriendly. Use a proper modal instead
– CertainPerformance
Nov 23 at 10:07












Thanks, but it is not really an option, because I do implement something in a legacy system, which I cannot touch. What I could verify that the alert is only a problem, if the alert gets opened within the event-listener of the parent-window. It seems that the open alert blocks any further events from being processed.
– Martin
Nov 23 at 10:37






Thanks, but it is not really an option, because I do implement something in a legacy system, which I cannot touch. What I could verify that the alert is only a problem, if the alert gets opened within the event-listener of the parent-window. It seems that the open alert blocks any further events from being processed.
– Martin
Nov 23 at 10:37



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53444557%2falert-blocks-cross-window-communication-in-ie%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53444557%2falert-blocks-cross-window-communication-in-ie%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)