Home  Beta programs 
  Welcome to Mobipocket Developer Center
powered by FreeFind

Creating Content

Getting Started
What is the Mobipocket file formatHow do I create a Mobipocket eBookStandard eBooksAdvanced eBooks
eBook features
Cross-platform feature supportImage supportTable supportCover PageParagraph rendering and hyphenationHyperlinksGuide itemsFramesIndexes and DictionariesSectionsAuthoring tips
Extended eBook features
DatabasesSQL queriesJavascriptHTML forms
Open-eBook HTML tagsSupported HTML entitiesHTML form tagsMobipocket custom tagsOPF x-metadata tagsMobipocket URLsMobipocket Document Object Model (DOM)Mobipocket Active Server Pages (ASP)Mobipocket Active Data Objects (ADO)Mobipocket Javascript Objects
Drug interaction module
Advanced topics
Setting margins
Home | Hide TOC | Download Sample | Add to Favorites updated: 2005-01-17

Hyperlinks in an eBook file
Scripting anchors using Javascript
Hyperlinks between different ebook files
  Linking to another ebook
  Linking to a specific location of another ebook
  Opening the index search in another ebook

Hyperlinks in an eBook file

You can use normal hyperlinks and anchors to define hyperlinks between HTML files part of a Open eBook Publication.

Scripting anchors using Javascript

In order to dynamically jump to a given anchor inside an eBook, using a Javascript call, you need to add a external="yes" attribute in the anchor tag.

<a name="part1" external="yes"/>

Note : external anchors need to have unique names among the entire eBook publication.

You can then access this anchor in Javascript

<form name="frm1">
<select name= "combo1"onchange="document.location.hash=this.value">
<option value="part1">First Chapter</option>
<option value="part2">Second Chapter</option>
<option value="part3">Third Chapter</option>

Hyperlinks between different ebook files

Linking to another ebook

You use the oeb:redirect special URL to link to a different ebook. The syntax is:

<a href="oeb:redirect?title=DatabaseName">External Link</a>

Where DatabaseName is the database name of the target ebook file to open. Using oeb:redirect, you do not have to know the exact location of the taget ebook on the device provided it is accessible from the library of the Mobipocket Reader.
You can specify the database name of an ebook using the <DatabaseName> entry in <x-metadata> part of the OPF publication file or use the one automatically computed by PRCGen from the book title. PRCGen displays the database name when compiling an ebook file using the following message: Info(prcgen): The document identifier is: "...."

WARNING: the database name is not the title of the document!

Linking to a specific location of another ebook

You can also link to an external anchor through the usual #anchor URL suffix as in HTML. Make sure the anchor has been defined with the external="yes" attribute in the source HTML otherwise this syntax will not work. 

<a href="oeb:redirect?title=DatabaseName#myanchor">External Link to myanchor in DatabaseName book </a>

Opening the index search in another ebook

You can call additional JavaScript functions after opening another ebook, for example, you can launch the index search view:

<a onclick="open('oeb:library?title=URLencodedDatabaseName');index_search()">Open index in book</a>


  • The ebook you are linking to must be listed in the Library of the Mobipocket Reader. If not, clicking on the link will do nothing.
  • If no position is specified, the ebook opens at the last opened page or the first page if it has never been opened.

Copyright 2000-2007 Mobipocket.com