Home

Keebler/Blog

« Kari Byron on MythBusters
Browser Built-in Editing Platforms »

Javascript In-Page Search Engine

I needed a search engine implemented really fast at work today so I whipped up this little Javascript search engine. All it does is iterate through the HTML DOM of a list (document.getElementById(…)), looking for list-items (.getElementsByTagName("li")) that match a regular expression. It then displays (.style.display="block") those items, while hiding the rest (.style.display="none"). A similar technique could be used to search entire pages (.getElementsByTagName("*")).

The technique runs pretty quick for running through 2000+ items, but it does hit the processor pretty hard.  Also, I’ve still got to figure out how to capture the "Enter key" event in Mozilla browsers…Sorrrry, let’s see how fast you can write a search engine! :D

CityTV | TV SHOWS | CityCooks

Related Posts

  • New Bittorrent Search Engine
  • Non-Linear Search Engine Optimization Session at RedDot Summit 2007
  • Infinite Scrolling on Live Image Search
  • Custom Javascript Error Handler
  • External Links List Javascript

This entry was posted on Tuesday, August 23rd, 2005 at 7:01 pm and is filed under Web Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

Click here to cancel reply.

  • Blog Home

  • Tags

    90210 alessandra ambrosio animals asp.net audrina patridge battlestar galactica bikini bunny bush C# canada canada election ctv ctvglobemedia development Election Entertainment/Celebrity facebook Gordon Ramsay gorilla gossip girl hayden panettiere iphone liveblog liveblogging mesh08 muchmusic Music nanotechnology obama palin rachel bilson scribblelive shenae grimes subway telemarketers the hills the killers the office toronto ttc toronto tv us election video yeah yeah yeahs

    WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

  • Recent Posts

    • Back from a run around Moore P…
    • I’m really hot in a 50×50px Ga…
    • RT @scribblelive: Our Dragons’…
    • Just 135 emails to go and my i…
    • RT @scribblelive: Our Dragons’…
  • Categories

    • Election
    • Entertainment/Celebrity
    • Fake News
    • Featured
    • Funny
    • Keebler/Show
    • Music
    • My Releases
    • On-the-Road
    • RedDot
    • Reviews
    • Science/Technology
    • ScribbleLive
    • Security
    • Software
    • Torrent Live Stats
    • Tweets
    • Uncategorized
    • Web Development
  • Blogroll

    • Kitten-Monkey’s Cell
    • :: kattekylling ::
    • Adam Finley
    • blog-j
    • fuzzz.gaulin.ca
    • Idiot Banter
    • mad.greyarea.com
    • ob.blog
    • PollyPrissyPants
    • RedDot CMS Users Google Group
    • ScribbleLive Official Blog
  • My Sites

    • Flickr2Facebook
    • RedDot CMS
    • ScribbleLive
    • Where are my f(acebook)ing friends?
    • WhyYouShould