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 Reference 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 Medical Drug interaction module Advanced topics Setting margins
|
Mobipocket Reader DOM
Object Hierarchy
Object List
Method List
window Object
Represents an open window in the reader.
Properties
Members
| Name |
Description |
| open |
opens a new PRC document |
| close |
Closes the current window |
| alert |
Displays a tooltip containing an application-defined message. |
| flash_message |
Displays a tooltip containing an application-defined message for a couple of seconds. |
| increase_font |
Increase the default font size of 1 increment |
| decrease_font |
Decrease the default font size of 1 increment |
| browse |
Opens a browse dialog box for selecting a document to open in the current window |
| display_tip |
display a tooltip window at pointer location |
| play_music |
starts play back of audio records |
| play_music_ex |
starts play back of audio records and start the voice recorder popup window, just after audio starts |
| start_recorder |
starts the voice recorder popup window |
| start_popup_viewer |
starts a popup window containing a multimedia ressource |
| start_external_app |
starts an external application |
| index_search |
Opens an index view on the specified index. |
| filtered_index_search |
Opens a filtered index view on an index. |
| cond_index_search |
Opens the index view on index entries matching the specified key. |
| sql_search |
Opens an index view on index entries matching the specified sql request. |
| sql_bullet_search |
Opens an index view on index entries matching the specified sql request. Entries also matching a second request are marked with the specified bullet. |
| move_table |
scroll big tables on the screen |
| display_bookmark_tip |
display in a tooltip window a bookmark tip |
| dial |
dials the default internet connexion |
open Method
Description: opens a new PRC document
Syntax:
window.open(url, [sTarget], [iTop], [iLeft], [iWidth], [iHeight], [bResize])
Remarks: This function is only available on the PC & WinCE version.
Examples:
<a onclick="window.open('test.prc')">
This is a Link</a> |
Parameters:
| Name |
Description |
| url |
the name of the document to open |
| sTarget |
if set to 'new', the document is opened in a new window |
| iTop |
the top position of the window |
| iLeft |
the left position of the window |
| iWidth |
the width of the window |
| iHeight |
the height of the window |
| bResize |
1 if the window is resizable, 0 else |
Applies to : window Object
close Method
Description: Closes the current window
Syntax:
window.close(
)
Applies to : window Object
alert Method
Description: Displays a tooltip containing an application-defined message.
Syntax:
window.alert(message)
Remarks: The user should click on the screen or press a key to discard the message.
Examples:
<a onclick="window.alert('Hello World')">
This is a Link</a> |
Parameters:
| Name |
Description |
| message |
the message to display |
Applies to : window Object
flash_message Method
Description: Displays a tooltip containing an application-defined message for a couple of seconds.
Syntax:
window.flash_message(message)
Remarks: Same as alert but the message is discarded automatically after a couple of seconds.
Examples:
<a onclick="window.flash_message('Hello World')">
This is a Link</a> |
Parameters:
| Name |
Description |
| message |
the message to display |
Applies to : window Object
increase_font Method
Description: Increase the default font size of 1 increment
Syntax:
window.increase_font(
)
Remarks: This applies to the whole reader
Examples:
<a onclick="window.increase_font()">
This is a Link</a> |
Applies to : window Object
decrease_font Method
Description: Decrease the default font size of 1 increment
Syntax:
window.decrease_font(
)
Remarks: This applies to the whole reader
Examples:
<a onclick="window.decrease_font()">
This is a Link</a> |
Applies to : window Object
browse Method
Description: Opens a browse dialog box for selecting a document to open in the current window
Syntax:
window.browse(
)
Remarks: Available supported document type are : .PRC, .HTM/.HTML, .TXT
Examples:
<a onclick="window.browse()">
This is a Link</a> |
Applies to : window Object
display_tip Method
Description: display a tooltip window at pointer location
Syntax:
window.display_tip(sText, iAlignment)
Remarks: Only raw text display is supported at this time
Examples:
<a onclick="window.display_tip('Simple tooltip text',0)">
This is a Link</a> |
Parameters:
| Name |
Description |
| sText |
the text to be displayed. It has to be raw text, i.e. without HTML tags |
| iAlignment |
the alignment of the text: 0 for top left and 1 for top right |
Applies to : window Object
play_music Method
Description: starts play back of audio records
Syntax:
window.play_music(sRecordList)
Remarks: Supported audio format depend on the Operating System & available audio player on the target devices.Audio files need to be referenced in the OPF file with a audio media-type in both the spine and manifest. Supported audio format is MP3/WMA.Requires Windows Media Player 7.1 or higher on Desktop PC (Windows 95 or higher) or PocketPC.
Examples:
<a onclick="window.play_music('#1,2,3')">
This is a Link</a> |
Parameters:
| Name |
Description |
| sRecordList |
a comma separated list of audio record index to be played in sequence (one after each other) |
Applies to : window Object
play_music_ex Method
Description: starts play back of audio records and start the voice recorder popup window, just after audio starts
Syntax:
window.play_music_ex(sRecordList)
Remarks: Supported audio format depend on the Operating System & available audio player on the target devices.
Parameters:
| Name |
Description |
| sRecordList |
a comma separated list of audio record index to be played in sequence (one after each other) |
Applies to : window Object
start_recorder Method
Description: starts the voice recorder popup window
Syntax:
window.start_recorder(
)
Remarks: The voice recorder popup window contains a record, stop and play button.Actual voice recording capabilities depend on the target operating ystem and the presecne of a microphone, speaker.
Examples:
<a onclick="window.start_recorder()">
This is a Link</a> |
Applies to : window Object
start_popup_viewer Method
Description: starts a popup window containing a multimedia ressource
Syntax:
window.start_popup_viewer(sUrl)
Remarks: This function is currently available on Windows 95/98/Me/NT/2000/XP operating systems only
Parameters:
| Name |
Description |
| sUrl |
the url of the multimedia file to be played. sUrl has to contain a short filename without any path.Only Flash Files & Windows Media Player suppored file types (MP3, WMA, MPEG,...) are supported |
Applies to : window Object
start_external_app Method
Description: starts an external application
Syntax:
window.start_external_app(sAppName, [sArg])
Remarks: This function is currently available on Windows 95/98/Me/NT/2000/XP operating systems only
Examples:
<a onclick="window.start_external_app('winword.exe')">
This is a Link</a> |
<a onclick="window.start_external_app('calc.exe')">
This is a Link</a> |
Parameters:
| Name |
Description |
| sAppName |
The full path of an application to be started. It can also be the full path of any registred document type |
| sArg |
an argument list to be passed to the application. |
Applies to : window Object
index_search Method
Description: Opens an index view on the specified index.
Syntax:
window.index_search([IndexName], [Caption], [InitialValue], [FrameSet], [Callback], [Flags])
Remarks: The index is displayed as an alpha-searchable list of items updated at every character entered in the search box. This allows the user find an entry by typing only the first characters.
Examples:
<a onclick="window.index_search()">
This is a Link</a> |
<a onclick="window.index_search('method')">
This is a Link</a> |
<a onclick="window.index_search('method','Caption: List of mehods in the Mobipocket reader DOM')">
This is a Link</a> |
Parameters:
| Name |
Description |
| IndexName |
The name of the index to be dispayed. This is the name defined in the content by the <idx:entry type="IndexName"> marker. This parameter defaults to the default index of the document which is the first index defined in the HTML data. |
| Caption |
The caption to be displayed at the top of the index view. |
| InitialValue |
You can use this parameter to specify the initial value to be displayed in the search box of the index view. |
| FrameSet |
Name of the frameset to use when in the index view. Framesets can be defined and named in <mbp:framseset name="..."> tags. If absent or empty, the frameset parameter defaults to the current frameset. To remove frames when switching to the index view, specify the name of a frameset that does not contain any frames. |
| Callback |
Name of a global JavaScript function to be called when the user clicks on a result in the index. The default behaviour is to jump to the clicked entry. This function can override it. The prototype of the function is: f_my_callback(RecordSet rc). It must have a single parameter of type RecordSet wich will be positionned on the index entry the user clicked. (requires version 4.8)
|
| Flags |
Configuration flags. See description link below. (requires version 5.0)
|
Additional remarks:
The precise description of index search configuration flags can be found here: Indexes and Dictionaries, common parameters.
Applies to : window Object
filtered_index_search Method
Description: Opens a filtered index view on an index.
Syntax:
window.filtered_index_search(IndexName, KeyIndexName, [Caption1], [Caption2], [InitialValue], [FrameSet], [Callback], [Flags])
Remarks: A filtered index view is a two-step process where the user
is first prompted to choose a keyword. The entries matching
this keyword are then displayed. For example, in an ebook catalog,
the user will first browse a list of authors and when he/she picks
one, the list of ebooks from that author will be displayed.
The index is displayed as an alpha-searchable list of items
updated at every character entered in the search box. This
allows the user find an entry by typing only the first characters.
Examples:
<a onclick="window.filtered_index_search('method','in_object')">
This is a Link</a> |
<a onclick="window.filtered_index_search('method','in_object','Choose an object', 'The methods supported by object %key are:')">
This is a Link</a> |
Parameters:
| Name |
Description |
| IndexName |
The name of the index containing searched entries. This is the name defined in the content by the <idx:entry type="IndexName"> marker. It can be '' (empty string) for the default index which is the first index defined in the HTML data. |
| KeyIndexName |
The name of the index containig search keys. This is the name defined in the content by the <idx:key type="KeyIndexName"> marker. It can be '' (empty string) for the default key index which is the first key index defined in the HTML data. |
| Caption1 |
The caption to be displayed at the top of the first screen (key index screen). |
| Caption2 |
The caption to be displayed at the top of the second screen (final index screen). You can use the %key string in the caption to display the item name chosen by the user in the previous screen. |
| InitialValue |
You can use this parameter to specify the initial value to be displayed in the search box of the index view (first screen). |
| FrameSet |
Name of the frameset to use when in the index view. Framesets can be defined and named in <mbp:framseset name="..."> tags. If absent or empty, the frameset parameter defaults to the current frameset. To remove frames when switching to the index view, specify the name of a frameset that does not contain any frames. |
| Callback |
Name of a global JavaScript function to be called when the user clicks on a result in the index. The default behaviour is to jump to the clicked entry. This function can override it. The prototype of the function is: f_my_callback(RecordSet rc). It must have a single parameter of type RecordSet wich will be positionned on the index entry the user clicked. (requires version 4.8)
|
| Flags |
Configuration flags. See description link below. (requires version 5.0)
|
Additional remarks:
The precise description of index search configuration flags can be found here: Indexes and Dictionaries, common parameters.
Applies to : window Object
cond_index_search Method
Description: Opens the index view on index entries matching the specified key.
Syntax:
window.cond_index_search(IndexName, KeyIndexName, Key, [Caption], [InitialValue], [FrameSet], [Callback], [Flags])
Remarks: This is similar to filtered_index_search but the search key is
specified in the parameters instead of being asked from the user.
The resulting index is displayed as an alpha-searchable list of items
updated at every character entered in the search box. This
allows the user find an entry by typing only the first characters.
Examples:
<a onclick="window.cond_index_search('method','in_object','window','Methods of the %key object')">
This is a Link</a> |
Parameters:
| Name |
Description |
| IndexName |
The name of the index containing searched entries. This is the name defined in the content by the <idx:entry type="IndexName"> marker. It can be '' (empty string) for the default index which is the first index defined in the HTML data. |
| KeyIndexName |
The name of the index containig search keys. This is the name defined in the content by the <idx:key type="KeyIndexName"> marker. It can be '' (empty string) for the default key index which is the first key index defined in the HTML data. |
| Key |
The key to be used. Only entries matching this search key will be displayed. |
| Caption |
The caption to be displayed at the top of the index view. You can use the %key string in the caption to display the 'Key' parameter. |
| InitialValue |
You can use this parameter to specify the initial value to be displayed in the search box of the index view (first screen). |
| FrameSet |
Name of the frameset to use when in the index view. Framesets can be defined and named in <mbp:framseset name="..."> tags. If absent or empty, the frameset parameter defaults to the current frameset. To remove frames when switching to the index view, specify the name of a frameset that does not contain any frames. |
| Callback |
Name of a global JavaScript function to be called when the user clicks on a result in the index. The default behaviour is to jump to the clicked entry. This function can override it. The prototype of the function is: f_my_callback(RecordSet rc). It must have a single parameter of type RecordSet wich will be positionned on the index entry the user clicked. (requires version 4.8)
|
| Flags |
Configuration flags. See description link below. (requires version 5.0)
|
Additional remarks:
The precise description of index search configuration flags can be found here: Indexes and Dictionaries, common parameters.
Applies to : window Object
sql_search Method
Description: Opens an index view on index entries matching the specified sql request.
Syntax:
window.sql_search(SQLRequest, [Caption], [FrameSet], [Callback], [Flags])
Remarks: The syntax of the SQL request must match the subset of the SQL language supported by the Mobipocket Reader. Reference documentation is appended to this document.
Examples:
<a onclick="window.sql_search('SELECT * FROM method WHERE in_object = \'history\'')">
This is a Link</a> |
<a onclick="window.sql_search('SELECT * FROM method WHERE in_object = \'history\' OR in_object = \'selection\'')">
This is a Link</a> |
<a onclick="window.sql_search('SELECT * FROM method WHERE in_object = ?', 'Choose an obect:%%%Methods supported by object %key are:')">
This is a Link</a> |
Parameters:
| Name |
Description |
| SQLRequest |
The request |
| Caption |
A combined caption string for all screns that will be displayed by the SQL request.
You should provide one caption message for every '?' operator used in the request
PLUS one caption string for the final results. Separate caption strings with %%% (three
consecutive percent characters). You can use the %key string to insert into the caption
the item name selected by the user in the previous screen. You can also use %1, %2, %3 and so on
to insert the item name chosen by the user in any previous screen (numbered from 1). |
| FrameSet |
Name of the frameset to use when in the index view. Framesets can be defined and named in <mbp:framseset name="..."> tags. If absent or empty, the frameset parameter defaults to the current frameset. To remove frames when switching to the index view, specify the name of a frameset that does not contain any frames. |
| Callback |
Name of a global JavaScript function to be called when the user clicks on a result in the index. The default behaviour is to jump to the clicked entry. This function can override it. The prototype of the function is: f_my_callback(RecordSet rc). It must have a single parameter of type RecordSet wich will be positionned on the index entry the user clicked. (requires version 4.8)
|
| Flags |
Configuration flags. See description link below. (requires version 5.0)
|
Additional remarks:
The precise description of index search configuration flags can be found here: Indexes and Dictionaries, common parameters.
Applies to : window Object
sql_bullet_search Method
Description: Opens an index view on index entries matching the specified sql request. Entries also matching a second request are marked with the specified bullet.
Syntax:
window.sql_bullet_search(BulletType, BullettedOnly, SQLRequest, [BulletSQLFragment], [Caption], [FrameSet], [Callback], [Flags])
Remarks: The first request is a full SQL request but the second one is just a fragment.
Bullets will be displayed in front of entries matching the request obtained
by combining the first request with the 'bullet' fragment using the AND operator.
The syntax of the SQL request must match the subset of the SQL language supported by the Mobipocket Reader. Reference documentation is appended to this document.
Examples:
<a onclick="window.sql_bullet_search(BUL_BLUE*1, false, 'SELECT * FROM method', 'in_object = \'window\'')">
This is a Link</a> |
Parameters:
| Name |
Description |
| BulletType |
Available bullet types are: BUL_BLUE, BUL_CROSS_RED, BUL_CHECK_GREEN, BUL_HOSPITAL. |
| BullettedOnly |
If this boolean is set, only entries with bullets are displayed. |
| SQLRequest |
The main request (for all entries) |
| BulletSQLFragment |
The 'bullet' part of the SQL request. Bullets will be displayed in front of entries matching the request obtained
by combining the 'SQLRequest' parameter with the 'BulletSQLFragment' fragment using the AND operator. |
| Caption |
A combined caption string for all screns that will be displayed by the SQL request.
You should provide one caption message for every '?' operator used in the request
PLUS one caption string for the final results. Separate caption strings with %%% (three
consecutive percent characters). You can use the %key string to insert into the caption
the item name selected by the user in the previous screen. You can also use %1, %2, %3 and so on
to insert the item name chosen by the user in any previous screen (numbered from 1). |
| FrameSet |
Name of the frameset to use when in the index view. Framesets can be defined and named in <mbp:framseset name="..."> tags. If absent or empty, the frameset parameter defaults to the current frameset. To remove frames when switching to the index view, specify the name of a frameset that does not contain any frames. |
| Callback |
Name of a global JavaScript function to be called when the user clicks on a result in the index. The default behaviour is to jump to the clicked entry. This function can override it. The prototype of the function is: f_my_callback(RecordSet rc). It must have a single parameter of type RecordSet wich will be positionned on the index entry the user clicked. (requires version 4.8)
|
| Flags |
Configuration flags. See description link below. (requires version 5.0)
|
Additional remarks:
The precise description of index search configuration flags can be found here: Indexes and Dictionaries, common parameters.
Applies to : window Object
move_table Method
Description: scroll big tables on the screen
Syntax:
window.move_table(TODO)
Parameters:
| Name |
Description |
| TODO |
TODO |
Applies to : window Object
display_bookmark_tip Method
Description: display in a tooltip window a bookmark tip
Syntax:
window.display_bookmark_tip(iID)
Remarks: Raw text only is currentlu suppored
Parameters:
| Name |
Description |
| iID |
the ID of the bookmark to be displayed |
Applies to : window Object
dial Method
Description: dials the default internet connexion
Syntax:
window.dial(
)
Remarks: Only supported on
Applies to : window Object
library Object
Represents the library object in the reader.
Properties No Properties
Members
book_details Method
Description: display the book details dialog box
Syntax:
library.book_details(sUrl)
Remarks: The book details dialog box enable the user to change the category of the book, access book size and delete it
Parameters:
| Name |
Description |
| sUrl |
the url of the book |
Applies to : library Object
category_details Method
Description: display the category details dialog box
Syntax:
library.category_details(sKey)
Remarks: The category details dialog box enables the user to change the category name
Parameters:
| Name |
Description |
| sKey |
the key for the category |
Applies to : library Object
create_category Method
Description: display a dialog box for creating a new category
Syntax:
library.create_category(
)
Applies to : library Object
history Object
Contains information about the URLs visited by the client.
Properties No Properties
Members
| Name |
Description |
| back |
Loads a URL from the History list. |
| forward |
Loads the next URL in the History list. |
back Method
Description: Loads a URL from the History list.
Syntax:
history.back(
)
Remarks: This method performs the same action as when a user clicks the Back button in the reader. An error does not occur if the user tries to go beyond the beginning of the history. Instead, the user remains at the current page.
Examples:
<a onclick="history.back()">
This is a Link</a> |
Applies to : history Object
forward Method
Description: Loads the next URL in the History list.
Syntax:
history.forward(
)
Remarks: This method performs the same action as when a user clicks the Forward button in the reader. An error does not occur if the user tries to go beyond the end of the history. Instead, the user remains at the current page.
Examples:
<a onclick="history.forward()">
This is a Link</a> |
Applies to : history Object
bookmarks Object
Contains information about the bookmarks relative to the current document.
Properties No Properties
Members
| Name |
Description |
| display_list |
Displays the bookmark list associated with the current document. |
| activate |
Acitivate the bookmark indentified by its key. |
| add |
Display a dialog box for adding a new bookmark on the current page. |
| goto |
navigate to the bookmark identified by its ID |
| next |
navigates to the next nearest boorkmak from the current position in the book. |
| previous |
navigates to the previous nearest boorkmak from the current position in the book. |
| details |
display the bookmark details dialog box identified by its ID |
| edit |
display the bookmark edit dialog box identified by its ID |
| delete |
delete the bookmark identified by its ID |
display_list Method
Description: Displays the bookmark list associated with the current document.
Syntax:
bookmarks.display_list(
)
Remarks: This method performs the same action as when a user clicks the Bookmark List menu item in the reader.
Examples:
<a onclick="document.bookmarks.display_list()">
This is a Link</a> |
Applies to : bookmarks Object
activate Method
Description: Acitivate the bookmark indentified by its key.
Syntax:
bookmarks.activate(iID)
Remarks: This method display the bookmark label in a tooltip. It performs the same action as when a user clicks the Bookmark anchor in the reader.
Examples:
<a onclick="document.bookmarks.activate(1)">
This is a Link</a> |
Parameters:
| Name |
Description |
| iID |
the id the bookmark to activate |
Applies to : bookmarks Object
add Method
Description: Display a dialog box for adding a new bookmark on the current page.
Syntax:
bookmarks.add([sLabel])
Remarks: If this method is called without any default parameter value, it displays the "Add bookmark" dialog box asking the user to enter a label.
Examples:
<a onclick="document.bookmarks.add()">
This is a Link</a> |
<a onclick="document.bookmarks.add('This is my bookamrk label')">
This is a Link</a> |
Parameters:
| Name |
Description |
| sLabel |
a label to name the bookmark. If present, no dialog box is displayed. |
Applies to : bookmarks Object
goto Method
Description: navigate to the bookmark identified by its ID
Syntax:
bookmarks.goto(iKey)
Examples:
<a onclick="document.bookmarks.goto(1)">
This is a Link</a> |
Parameters:
| Name |
Description |
| iKey |
the id the bookmark to activate |
Applies to : bookmarks Object
next Method
Description: navigates to the next nearest boorkmak from the current position in the book.
Syntax:
bookmarks.next(
)
Remarks: This method performs the same action as when a user clicks on the right arrow at the right of the progress bar in the reader. If there is no more bookmark next to the current position, it goes to the first bookmark in the book.
Examples:
<a onclick="document.bookmarks.next()">
This is a Link</a> |
Applies to : bookmarks Object
previous Method
Description: navigates to the previous nearest boorkmak from the current position in the book.
Syntax:
bookmarks.previous(
)
Remarks: This method performs the same action as when a user clicks on the leftarrow at the left of the progress bar in the reader. If there is no more bookmark previous from the current position, it goes to the last bookmark in the book.
Examples:
<a onclick="document.bookmarks.previous()">
This is a Link</a> |
Applies to : bookmarks Object
details Method
Description: display the bookmark details dialog box identified by its ID
Syntax:
bookmarks.details(iKey)
Remarks: The bookmark details dialog box enables to delete the bookmark.
Examples:
<a onclick="document.bookmarks.details(1)">
This is a Link</a> |
Parameters:
| Name |
Description |
| iKey |
the id the bookmark |
Applies to : bookmarks Object
edit Method
Description: display the bookmark edit dialog box identified by its ID
Syntax:
bookmarks.edit(iKey)
Remarks: The bookmark details dialog box enables to change the bookmark label.
Examples:
<a onclick="document.bookmarks.edit(1)">
This is a Link</a> |
Parameters:
| Name |
Description |
| iKey |
the id the bookmark |
Applies to : bookmarks Object
delete Method
Description: delete the bookmark identified by its ID
Syntax:
bookmarks.delete(iKey)
Examples:
<a onclick="document.bookmarks.delete(1)">
This is a Link</a> |
Parameters:
| Name |
Description |
| iKey |
the id the bookmark |
Applies to : bookmarks Object
document Object
Represents the current opened eBook.
Properties
Members
| Name |
Description |
| goto_page |
Displays a popup dialog box for going to a given page in the document, if there is no parameter. If there is a parameter, which is a page number, the reader anvigates directly to this page, without displaying any dialog box. |
| goto_page_relative |
Navigates to a page, relative to the current position. If the current view is an index view, it scrolls down the index if PageCount is > 0 and scrolls up the index if PageCount is <0 (requires Mobpocket Reader 4.7 Build 409 or higher) |
| goto_first_page |
Goes to the first page of the eBook. |
| goto_last_page |
Goes to the last page of the eBook. |
| goto_toc |
Goes the table of content of the eBook |
| goto_guide |
goes to a guide item of the book |
| search |
Dispays the search dialog box to perform full text search inside the current eBook. Search is performed by default from the current position in the document. |
goto_page Method
Description: Displays a popup dialog box for going to a given page in the document, if there is no parameter. If there is a parameter, which is a page number, the reader anvigates directly to this page, without displaying any dialog box.
Syntax:
document.goto_page([pageNumber])
Examples:
<a onclick="document.goto_page()">
This is a Link</a> |
<a onclick="document.goto_page(3)">
This is a Link</a> |
Parameters:
| Name |
Description |
| pageNumber |
a page number |
Applies to : document Object
goto_page_relative Method
Description: Navigates to a page, relative to the current position. If the current view is an index view, it scrolls down the index if PageCount is > 0 and scrolls up the index if PageCount is <0 (requires Mobpocket Reader 4.7 Build 409 or higher)
Syntax:
document.goto_page_relative(PageCount)
Remarks: Use this function to script the next page / previous page action or the scroll up/down action in the index view.
Examples:
<a onclick="document.goto_page_relative(1)">
This is a Link</a> |
<a onclick="document.goto_page_relative(-1)">
This is a Link</a> |
Parameters:
| Name |
Description |
| PageCount |
A positive or negatvive number which indicates the page of pages after or before to navigate from the current page. |
Applies to : document Object
goto_first_page Method
Description: Goes to the first page of the eBook.
Syntax:
document.goto_first_page(
)
Examples:
<a onclick="document.goto_first_page()">
This is a Link</a> |
Applies to : document Object
goto_last_page Method
Description: Goes to the last page of the eBook.
Syntax:
document.goto_last_page(
)
Examples:
<a onclick="document.goto_last_page()">
This is a Link</a> |
Applies to : document Object
goto_toc Method
Description: Goes the table of content of the eBook
Syntax:
document.goto_toc(
)
Remarks: The Table of Content of an eBook is specified in the Guide section of the Open-eBook Publication file (.OPF) at publishing stage. A guide item, with a "toc" type indicates a table of content. If no table of content is specified, it goes to the first page.
Examples:
<a onclick="document.goto_toc()">
This is a Link</a> |
Applies to : document Object
goto_guide Method
Description: goes to a guide item of the book
Syntax:
document.goto_guide(iGuideIndex)
Remarks: If the eBook does not have any guide items or the index specified is out of range, this function does nothing
Examples:
<a onclick="document.goto_guide(1)">
This is a Link</a> |
Parameters:
| Name |
Description |
| iGuideIndex |
The index of the guide item to navigate to. |
Applies to : document Object
search Method
Description: Dispays the search dialog box to perform full text search inside the current eBook. Search is performed by default from the current position in the document.
Syntax:
document.search(
)
Examples:
<a onclick="document.search()">
This is a Link</a> |
Applies to : document Object
selection Object
Represents the piece of text selected using the mouse or the stylus in the current eBook.
Properties No Properties
Members
| Name |
Description |
| copy |
Copies the selection in the clipobard |
| highlight |
Highlight the selection. |
| annotate |
Displays the Annotation dialog box. |
| lookup |
Lookup the selected text into the default dictionary. |
copy Method
Description: Copies the selection in the clipobard
Syntax:
selection.copy(
)
Remarks: This method is avaialable only for non encrypted eBooks.
Examples:
<a onclick="document.selection.copy()">
This is a Link</a> |
Applies to : selection Object
highlight Method
Description: Highlight the selection.
Syntax:
selection.highlight(
)
Remarks: Highlight color is set currently to yellow by the Reader. Next version of the Reader will allow the change highlight color in the settings.
Examples:
<a onclick="document.selection.highlight()">
This is a Link</a> |
Applies to : selection Object
annotate Method
Description: Displays the Annotation dialog box.
Syntax:
selection.annotate(
)
Remarks: Highlight color is set currently to yellow by the Reader. Next version of the Reader will allow the change highlight color in the settings.
Examples:
<a onclick="document.selection.annotate()">
This is a Link</a> |
Applies to : selection Object
lookup Method
Description: Lookup the selected text into the default dictionary.
Syntax:
selection.lookup(
)
Remarks: Default lookup dictionnary can be changed in the settings page.
Examples:
<a onclick="document.selection.lookup()">
This is a Link</a> |
Applies to : selection Object
location Object
Contains information on the current URL.
Properties
Members
hash Property
Description: This property is useful for moving to a bookmark within a document. Assigning an invalid value does not cause an error. This property has write permissions, meaning you can change as well but you cannot retrieve the current value.
Remarks: You can only navigate to anchors which are defined as external, with a external="yes" attribute.
Examples:
<a onclick="document.location.hash = 'anchor1'">
This is a Link</a> |
|