1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

added loading from zipped epub file

This commit is contained in:
Fred Chasen 2013-01-26 21:01:14 -08:00
parent 2ddae3a024
commit 1e592badd1
13 changed files with 288 additions and 57 deletions

View file

@ -163,3 +163,21 @@ FP.core.dataURLToBlob = function(dataURL) {
return new Blob([uInt8Array], {type: contentType});
}
//-- Load scripts async: http://stackoverflow.com/questions/7718935/load-scripts-asynchronously
FP.core.loadScript = function(src, callback) {
var s, r;
r = false;
s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = src;
s.onload = s.onreadystatechange = function() {
//console.log( this.readyState ); //uncomment this line to see which ready states are called.
if ( !r && (!this.readyState || this.readyState == 'complete') )
{
r = true;
callback();
}
};
document.body.appendChild(s);
}