The Doc Dialer
The Doc Dialer
In this column we embark on a series of columns that will review the new features of Internet Explorer 5.5, and there are a lot of them. We also introduce a new application this column: The Doc Dialer. We'll keep enhancing it over a few columns, interleaving new features from Internet Explorer 5.5 as we go along. We'll emphasize in this series cross-browser methodologies, working with DHTML elements, utilizing the DOM, and implementation of advanced data structures and algorithms.
The Doc Dialer is an information indexing and retrieval instrument. It is based on the fact that eight out of the ten numeric keys on the phone keypad are labeled with 24 characters of the English alphabet. Conceptually, you can use these keys to enter any string for either storage or retrieval of information. As the characters Q and Z are missing from the phone keypad, we assume these characters can be omitted from this indexing system with only a slight penalty on its usability.
In this column we introduce version 1 of our Doc Dialer. This phone includes a traditional phone keypad and a small display. The information subject is US presidents (just in time for Presidents' Day). When you key in a president name, the display shows two links for every matched name: a link to its biography and a four-digit indexing number that can be possibly used to retrieve additional information from some internet-based database. The Doc Dialer displays all names that could match the keys pressed so far. The current version is supported only by Internet Explorer. The presidents we support are Ronald Reagan, Jimmy Carter, Richard Nixon, Bill Clinton, Gerald Ford, George Bush, Lyndon Johnson, and John Kennedy. You can key in their first name followed by their last name, or vice versa. For example: GERALDFORD, BUSHGEORGE, and LYNDON are all valid entries.
In this column, you'll learn:
- How to create a trie data structure
- How to store the president names in the Doc Dialer
- How to initialize the global arrays
- How to implement the phone keypad
- How to handle a button click
- How to collect data entries down the trie
- How to display the matched names
- How to use the new IE 5.5's replace() function
We also include the listing of our Doc Dialer and its zipped version.
Produced by Yehuda Shiran and Tomer Shiran
Created: February 14, 2000
Revised: April 26, 2000
URL: https://www.webreference.com/js/column57/