Javascript not highlighting in sequence

Druggy

New Member
I'm using this code to highlight each instance of a searched string in a UIWebView.It works great when I'm searching a small file, but when I have one that has a lot of words like 17,000 or 18,000 it is doing something strange with the sequence number.What happens is the counting starts out at like 190 and counts up to 400 and something then starts back at 0.When I search for a string that there are only 83 occurrences of the sequence number starts at 37, counts up to 82 and starts back at 0.Here's the fiddle http://jsfiddle.net/ykzap/2/Any help would be much appreciated, I'm a NOOB with javascript obviously! Please tell me if I need to be more clear about anything. MANY thanks in advance, I've been pulling my hair out over this for 2 days now. :-(
 
Back
Top