fetch Content Location From Href
Fetches a ContentLocation for hrefs like chapter02.xhtml#title-4
.
If href
is a relative URL, you can specify a baseUrl
to from where href
is relative to. If you don't specify a baseUrl
it will default to the root of the EPUB.
For example: To resolve a relative href
link found in a ReaderDocument, you should pass the URL of that ReaderDocument as baseUrl:
readerPublication.fetchContentLocationFromHref(href, readerDocument.sourceContentDocument.contentUrl, {...}, {...})
onError is called if:
href
does not resolve to aReaderDocument
in this publication.a "#hash" is specified in
href
and does not match any element id in the document.
Fetches a ContentLocation for hrefs like chapter02.xhtml#title-4
.
If href
is a relative URL, you can specify a baseUrl
to from where href
is relative to. If you don't specify a baseUrl
it will default to the root of the EPUB.
For example: To resolve a relative href
link found in a ReaderDocument, you should pass the URL of that ReaderDocument as baseUrl:
readerPublication.fetchContentLocationFromHref(href, readerDocument.sourceContentDocument.contentUrl)
The returned ColibrioResult is an error if:
href
does not resolve to aReaderDocument
in this publication.a "#hash" is specified in
href
and does not match any element id in the document.