Skip to content

Instantly share code, notes, and snippets.

@doochik
Created November 26, 2014 16:25
Show Gist options
  • Save doochik/575b94b20765b028dc70 to your computer and use it in GitHub Desktop.
Save doochik/575b94b20765b028dc70 to your computer and use it in GitHub Desktop.
IE10/11 can't execute blob-js with 114688 bytes size
var text = "var a = '";
for (var i = text.length; i < 114686; i++) {
text += '1';
}
text += "';";
console.log('text size:', text.length);
var blob = new Blob([text], {type: 'text/javascript'});
var url = URL.createObjectURL(blob);
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.setAttribute('charset', 'utf-8');
// no events for size 114688
script.onload = function() { console.log('onload'); };
script.onerror = function() { console.log('onerror'); };
script.onreadystatechange = function() { console.log('onreadystatechange'); };
script.setAttribute('src', url);
document.body.appendChild(script);
@azproduction
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment