A couple of weeks ago, a client brought us an interesting problem. They wanted
a function to search their rather massive catalog. The only problem? Their
company has a content management system (CMS) that does not allow any server
side scripts execute. The data was stored in a bunch of Excel spread sheets
thus requiring us to batch process it.
We wrote a macro
to export the file to XML and clean it – long story!
We re-wrote a similar script using jQuery frame work.
It uses a RegExp object
to handle the match and also added the tablesorter
jQuery plugin to improve the usability. Added some validation and such and viola, it became a neat little tool. Thought we’d share…
First thing first
You’ll notice I’ve added an id and xmlData attributes to
the search.js reference. This is the best way to pass the xml file
location from the HTML file. This helps a great deal if you have multiple xml
files you want to use as data source. The XML data source can be
structured in any way or can be any size. You can also add
attributes for more data pointers. Here is a sample XML:
Here is the sample HTML that will work with the code above.
Release mambo jumbo: You may use this script as you see it fit.
A few folks have asked us about an issue with IE. The code base works with IE,
but in order to test it, you’ll have to upload it to a server. Please
check out our demo.
BLEN Corp is a small, minority and veteran-owned information technology firm located in Washington D.C. Since 2004, we have been ahead of the curve in early adaption and implementation of cutting edge technologies including web and mobile development, service-oriented architecture, and other innovative web based solutions. Look at some of our projects.
655 New York Ave NW
Washington, DC 20001