Why 'post' shows in between 1 and 2?
Last active
June 2, 2016 19:52
-
-
Save normanzb/891e1b87cd4a900799ad35c69910327a to your computer and use it in GitHub Desktop.
IE async task strange behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onmessage = function(event){ | |
var data = event.data; | |
if(data&&data.purpose=='seti'){console.log('post')} | |
}; | |
setTimeout(function(){console.log(0)},0); | |
setImmediate(function(){console.log(1)}); | |
setImmediate(function(){console.log(2)}); | |
window.postMessage({purpose:'seti'},location.protocol + '//' + location.host); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment