W3C home > Mailing lists > Public > www-amaya-dev@w3.org > March 2003

get byte offset from document

From: li zhang cis student <lz3@oak.njit.edu>
Date: Fri, 21 Mar 2003 10:46:54 -0500 (EST)
To: www-amaya-dev@w3.org
cc: www-amaya@w3.org
Message-ID: <Pine.GSO.4.53.0303211031340.7949@argerich.njit.edu>

Hi All,

I have a question about how to get the byte offset
of selected text from a HTML file. For example,
if I have the following HTML file:

<title>This is a test example</title>
<body><tr><h1>test test test</h1></tr>
<h2>test test</h2>

If the user selects "test" from the screen,
I need to know the position of this "test"
in the HTML file. Because there are 6 "test"
string in the file, I need to know which one
does the user selects.
Does Amaya has a way to support this? Or any other
browser? I know I can use javascript to get
the content of the selection (document.getselection),
but I don't know how to get the byte offset of
this selection.


Received on Friday, 21 March 2003 10:47:01 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:25:49 UTC