Skip to content

Instantly share code, notes, and snippets.

@normanzb
Last active June 2, 2016 19:52
Show Gist options
  • Save normanzb/891e1b87cd4a900799ad35c69910327a to your computer and use it in GitHub Desktop.
Save normanzb/891e1b87cd4a900799ad35c69910327a to your computer and use it in GitHub Desktop.
IE async task strange behavior

Why 'post' shows in between 1 and 2?

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