Closed kenkiku1021 closed 4 years ago
When using javascript in the EPUB document for XHR, MS Edge browser and Firefox cannot get XHR target.
http://example.com/bibi/
+bookshelf +book1 +OEBPS -p1.xhtml -p1.js -data.json +i -index.html
// p1.js document.addEventListener("DOMContentLoaded", function() { var xhr = new XMLHttpRequest(); xhr.open("GET", "data.json"); xhr.send(); alert(location.href); });
Can get "data.json", alert shows : http://example.com/bibi/bookshelf/book1/OEBPS/p1.xhtml
Cannot get "data.json" and XHR request send to wrong URI (http://example.com/bibi/i/data.json). alert shows : http://example.com/bibi/i/?book=book1 It seems that document in the BiBi's iframe recognize wrong location.
I know that I should not use javascript and XHR in the EPUB. But I want to use it.
It seems difficult to get to your request, sorry.
When using javascript in the EPUB document for XHR, MS Edge browser and Firefox cannot get XHR target.
example
http://example.com/bibi/
result
Chrome / Safari / IE11
Can get "data.json", alert shows : http://example.com/bibi/bookshelf/book1/OEBPS/p1.xhtml
Edge / Firefox
Cannot get "data.json" and XHR request send to wrong URI (http://example.com/bibi/i/data.json). alert shows : http://example.com/bibi/i/?book=book1 It seems that document in the BiBi's iframe recognize wrong location.
I know that I should not use javascript and XHR in the EPUB. But I want to use it.