04-27-2015, 03:18 PM | #1 |
Junior Member
Posts: 6
Karma: 10
Join Date: Jul 2006
Location: Waterloo, Ontario, Canada
|
Loading external file via Ajax.
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]; } }); |
04-27-2015, 10:50 PM | #2 |
creator of calibre
Posts: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre uses WebKit, so ajaz should work fine. "Pretty much dies" is not very illuminating. Use the Console or run the viewer in debug mode
calibre-debug -w |
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SVG images, external file versus inline | j.p.s | ePub | 4 | 07-18-2014 11:30 AM |
Loading a png file | dragon123 | Kindle Developer's Corner | 1 | 12-06-2013 12:22 PM |
External viewer opens temp file | Aiwass | Library Management | 4 | 04-29-2013 04:44 AM |
External CSS file questions | michaelbr | Sigil | 10 | 01-27-2011 08:08 AM |
Large sony file not loading | markiehill | Sony Reader | 3 | 10-10-2008 12:10 PM |