PDA

View Full Version : Using JavaScript to Search For and Highlight Text on a Web Page



Niao Jina
10-08-2013, 11:36 PM
Please see the URL : http://evening.engellee.com/eveningHighlightSearch/
My Sample's features

Search by Node.textContent property. So, searching is satisfied because Skip All HTML Elements themselves such as input, span, div, title, etc.
Support IE9,10/FF/Chrome/Opera/Safari(Win,MAC,iOS)
Searching is possible when keywords length is over 2. e.g. ie, sp, high
Implement 3 kind of Search Engine : For example in the sentence "Using JavaScript to Search For and Highlight Text on a Web Page"

[Level-1] Case-sensitive
Searched Color :
True : [Web Page]
False [web page][wEB Page]

[Level-2] non-Case-Sensitive
Searched Color :
True : [Web Page][web page][wEb pAGe] etc
False [web javascript][JavaScript highlight]

[Level-3] Mutltiple Search and non-Case-Sensitive
Searched Color :
Possible : [web javascript][JavaScript highlight IE]

Thanks for your time.

Kind regards
Niao Jina

jscheuer1
10-09-2013, 12:37 AM
Are you offering this code free to anyone to use for any purpose?

If so, would you like to submit it to Dynamic Drive for inclusion in their Javascript Library?

Niao Jina
10-15-2013, 06:00 AM
Dear Sir
I am sorry for the delay response.
I will offer my code as a free.
Now, what do I have to ?
Please help me.

Kind regards
Niao Jina

jscheuer1
10-15-2013, 06:12 AM
Well, as long as you are the author, just by stating that it is free makes it so. If you want to submit it, post it in the submissions section:

http://www.dynamicdrive.com/forums/forumdisplay.php?3-Submit-a-DHTML-or-CSS-code

There's no guarantee it will be accepted. But that's how to offer it for inclusion in the Dynamic Drive Library.