I need to start the search and replace it with HTML like the following ... I need to have the "Find next", "Replace" and "Replace all" options .... the trick is that I need to run an AJAX request to update the values ββin the database for each field after replacing the value.
The only problem I encountered is that I donβt know exactly how to search for the contents of #sheet and replace the values ββwith the new value that the user provided.
<div id='sheet'> <div class='item' id='field-18583'>This is yet another test</div> <div class='item' id='field-18585'>This is test data</div> </div>
I have to say that it is possible that I will have TONS of text to search, so ideally I would find only the next instance of the object that was found, and not all instances. Therefore, when I click "Find Next", if I am "m 3", it will go to the fourth.
What is the best way in javascript to support indexing on it without storing all the results found in a variable and causing a delay on the page?
source share