Tuesday, March 27, 2007

Searching with JQuery

JQuery a powerful Javascript "wrapper" contains massive amounts of plugins from the supporting GENIUS community.

At the moment I'm working on a small project that requires me to highlight search result sets. The database currently returns clean text to my application. I thought it would be a good idea to either have the database return the html based on the string I am searching for or parse the result set and append the html that way before sending it to the browser.



Then Javascript came to mind, with that I looked into JQuery -> Less code and fast! At the moment I am able to have JQuery traverse the section of my page (a simple div container) which and have it append the html on the term I am searching for. I have not been completely successful. I am only appending to the first occurrence of the term, meaning I'm not traversing the page correctly. Being that I am very new to web programming, I have a feeling it will take me a little more time and research to figure out a fast way to traverse the page client-side.



With all that said, I will be sure to post my results and of course the code I used to get to it! Until then ALL input and help is welcomed!