Hi!
I'm trying to load an external file into my ebook via an Ajax call. The file is local to the EPUB document. However, it's not working -- does Calibre support this?
Here's the code I'm using:
Code:
$.ajax({
async: false,
url: theExternalDocument,
dataType: 'xml',
success: function(data) {
var xmlData = new XMLSerializer();
var strungData = xmlData.serializeToString(data);
var fixedData = strungData.replace(/\<(\?xml|(\!DOCTYPE[^\>\[]+(\[[^\]]+)?))+[^>]+\>/g, '');
documents[b] = new Array();
documents[b]['contents'] = $("body", $("<div>" + fixedData + "</div>")).html();
documents[b]['url'] = uniqueReferences[index];
}
});
It's working in iBooks, Readium, etc., but pretty much dies in Calibre.