17th September, 2004

Live Search and browser woes

Inspired (truly inspired) by Apple’s forthcoming Spotlight tool (below), and the Live Search tool created by Chregu over at Bitflux, I’ve implemented a similar search method here on CollyLogic - but not without running into browser issues (it doesn’t work on my Firefox, or on IE Mac, or on early versions of Safari). This is all purely experimental at the moment, but feedback is appreciated. Read on for more…

image

image

What does this Live Search do then?

Well, if you type a letter into the search box in the sidebar, the system will automatically pump out ten blog entry titles containing that letter. As you type more characters, the list automatically refines the results. It all happens on the fly, and (so long as you have Javascript enabled) it’s a mighty-fine search method. Try typing ‘ice’ letter-by-letter and see the results list develop below the search box. There are still a few teething problems though. If you use your ‘back’ button, you’ll find that the thing stops working. Also, once in a blue moon, you get a ‘no results’ when there clearly are results to be had (this is also down to ‘back button’ abuse). I’m also aware that the ‘ticks’ are doubling-up/looking a bit sporadic/ugly on IE PC. Naturally, it looks fine on a Mac. Let me know if you spot any other probs.

It was by no means easy to implement this with my CMS, but it does seem to be working. I had to force it to not search in certain sections, and point the results at the appropriate ‘comments’ page etc. Still, this is all done, but the horror of getting the list-style to work properly was causing me grief. Each item is pumped out with <li> tags on either side, as I need. But specifying the <ul> within the <form> element, and within the PHP and javascript, and making the whole thing validate was a nightmare.

Do you want it? Ooh, Sir…

Apparently, Chregu has had a tremendous response to the script, and a Live Search wiki has been set up, where you can access the Javascript, and find more answers. At the time of writing, the browser situation looks like this:

Supported:

  • MSIE 5.0 upwards
  • Mozilla/Firefox (Since at least Mozilla 1.0) although it ain’t working on my copy of Firefox
  • Safari 1.2

Not supported:

  • Konqueror
  • Opera
  • Internet Explorer 5 (Mac)

I’m particularly interested in this Live Search stuff because of the potential use of the script to perform other live functions in tandem with my CMS. Anyway, forgive me for the cathartic waffling this morning - but it’s much better than purely banging my head against the office wall.

Also, check out Garrett’s beautiful implementation of the technique over at Maniacal rage.

Prev / Next

Tags

If you enjoyed this article, please subscribe to my Internet of Natural Things letter, and maybe grab the RSS feed. Thank you.