AJAX: Dictionary Search

less than 1 minute read

Much like a suggestive search I’ve created a relatively small application to search through a 1.2MB Dictionary file which is delimited by line-breaks (\n). This example updates the contents of a div container on each keystroke. For this example the prototype framework, a dictionary file from winedt.org and PHP as the actual Server-Side parser were used to display the results. If you want to see the entire code and how to call the objects, right-click on the example page and click on “view source”, the PHP and JavaScript Sources are displayed below.

PHP Code:

// removed unsafe code

Simple PHP code link this could easily be adapted to retrieve results from a SQL database or an XML file.

You may get the JavaScript and HTML source by right-clicking on the page and viewing the source, it’s all open.

Link removed.

Updated: