Highlighting with window.find

  • Thread starter Yves-Alain NICOLLET
  • Start date
Y

Yves-Alain NICOLLET

With Netscape, you can use window.find to highlight some text. But it
does so only on the first occurence.

Has someone a solution to highlight all the occurences?

And to add some complexity to my simple question, has someone a
solution compatible with both Netscape and Internet Explorer?

Thanks.
 
D

Duncan M.

With Netscape, you can use window.find to highlight some text. But it
does so only on the first occurence.
Has someone a solution to highlight all the occurences?

And to add some complexity to my simple question, has someone a
solution compatible with both Netscape and Internet Explorer?

The find functionality of the browsers I know highlight one occurance at the
time. These javascript attempt to mimic that:
http://www.hypergurl.com/searchpage.html
http://tech.irt.org/articles/js041/

Another approach is to call up the finf dialog itself (NS only):
http://www.devguru.com/Technologies/ecmascript/quickref/win_find.html

To highlight all occurances simultaneously, see
http://4umi.com/code/highlighttext.htm
HTH
Ivo
 
Y

Yves-Alain NICOLLET

The last item (highlight all occurences simultaneously) is *almost* what
I'm looking for. Almost, because it works only with MSIE. I need a
solution compatible with at least MSIE and NS.
Thanks anyway.
 
I

Ivo

Ivo wrote
The last item (highlight all occurences simultaneously) is *almost* what
I'm looking for. Almost, because it works only with MSIE. I need a
solution compatible with at least MSIE and NS.

Sorry, I don't know about Netscape, but to say the script is IE-only is an
insult. It also delivers the goods in Mozilla (1.0 even). But if you find or
make something better, I 'd be very interested to hear it. Working as it
does with standard DOM methods, I would guess there 's a bug with the script
in NS which you might be able to identify and solve...
Ivo
 
Y

Yves-Alain NICOLLET

With Netscape, you can use window.find to highlight some text. But it
does so only on the first occurence.

Has someone a solution to highlight all the occurences?

And to add some complexity to my simple question, has someone a
solution compatible with both Netscape and Internet Explorer?

Thanks.

I received a reply from Developersdex <[email protected]>,
pointing me to
http://4umi.com/code/highlighttext.htm
which seems a good demo for what I want to do.
Unfortunately, this script does not work with NS(4.7 nor 4.8) but
works with MSIE, Mozilla and NS7. I need to have a solution also
working with NS4.7 or NS4.8.
Any help *very much* appreciated...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top