On Dec 15, 2:18 pm, anmldr <[email protected]> wrote:
> I have been searching for a JavaScript that would find a string in a
> page, highlight the found string and scroll to the found string.

Probably because designing such a script for a general case is a
practical impossibility. It may be possible given suitable constraints
on the text to be searched and the functionality to be provided. Some
of the issues you need to consider:

1. How to deal with multiple matches

2. Should whole words be matched, any string, or is there a choice?

3. How to deal with strings split over multiple elements

   e.g. try matching "be quiet" in the following:

   <li>Please be <em>quiet</em> in the library

4. How will inserting extra elements in the markup affect the
document?

   e.g. if using A elements and matching foo bar:

   <li><strong>foo bar fud</strong>

   becomes

   <li><strong><a ...>foo bar</a> fud</strong>

There are many more, the above are just a few that come to mind
quickly.


> I
> can't seem to find one that will work on the iOS.  Does anyone have
> something that works? Will you share?

If you provide some specific requirements that deal with the issues
noted above, it may be possible.


--
Rob

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to