A Safer way to high light texts on html pages.

I suggested a method to highlight a text in a html page using javascript replace command and regular expressions in my last post. the problem with that code is showing up when your search keyword matches with your html tags and styles then it destroys the html structure of the page.
I just found a new better way to highlight texts (even segmented ones) on a html page. this code even can dettect the refferer search keywords and highlight them on the current page. for instance if your page is opened using a google search it can highlight the searched keywords that you have used on the google search page using referer object.

http://www.nsftools.com/misc/SearchAndHighlight.htm

please leave your comments and suggestions…

Leave a comment

Please be polite and on topic. Your e-mail will never be published.

You must be logged in to post a comment.