简体   繁体   中英

JavaScript Find In .TXT File

I have exhausted google for a JavaScript "Find In Page" tool to place in a HTML file so that when I enter a search term and click submit, the script will search a TEXT file of my choice and find a match on the text page for the entry submitted.

This is an example of what I'm looking for:

Page A - This is the start page:

http://mobilestimulus.com/tests/field_search/index

Employee enters part# on page A, and Part# is highlighted on page B.

Page B, the page to be searched, is a .txt file. Example:

http://mobilestimulus.com/tests/field_search/file1

I asked this in another thread, but the methods given won't do the trick, and the thread got marked Answed. Can someone give me a hand? Thanks.

From what I have understood I think you should use your server side language for searching the part#. You can write the code to parse the file and find the part# entered in the first page. You can not use javascript to read from a file on server(I suppose if I've followed the question correctly pageB resides on server).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM