Happy New Year
Now the dictionary includes, FOLDOC- The free online dictionary of computing. It has around 14000 computer terms. Try it out.
Now the dictionary includes, FOLDOC- The free online dictionary of computing. It has around 14000 computer terms. Try it out.
January 2nd, 2005 at 1:12 am
Slightly offtopic, but I thought of a simple way you could lessen the load on your server.
You mentioned in your explaination that you were using the onkeyup event to send the requests. A way of stopping the /. weenies from borking your server would be to change the code in the code to the following:
var idTimer = null;
function SendQuery(key)
{
var url = “http://www.objectgraph.com/dictionary/dict.aspx?k=” + key;
// Stop the previous timer (if any) from firing.
if (idTimer != null)
window.clearTimeout(idTimer);
// This code is ran if a key hasn’t been pressed for quarter a second.
var handler = function()
{
Initialize();
if (req != null)
{
req.onreadystatechange = Process;
req.open(”GET”, url, true);
req.send(null);
}
};
// Set the handler to run after a quarter a second.
idTimer = window.setTimeout(handler, 250);
}
I wish Blogger allowed preformatted blocks.
This makes it wait until the user has stopped typing for a reasonable period (250ms) before firing back to the server to pull stuff from the dictionary.
Note that I just typed this up off the top of my head and haven’t tested it, so you should make sure it works before you put it online.
January 2nd, 2005 at 11:54 am
Cool Idea,
the only problem i have is, if the person just leaves the computer idle with some text already typed in the box, wouldnt that keep on hitting the server?
January 3rd, 2005 at 12:53 pm
No, once the event fires, it should disappear. Timeout isn’t for recurring events, just once-offs. Even then, you could cancel it once it fires even if it did.
January 4th, 2005 at 2:47 am
Cool,
I will implement this and post the source code.
Thank you for the suggestion.
January 5th, 2005 at 3:51 am
I really like what you’ve done here. I will probably dream tonight as I sleep about this program hooking up with onelook.com
February 9th, 2005 at 5:05 am
OFF TOPIC! Fun things to do….
Please Delete this post if this is not ok!
Inspirational Posters
Adult Sexo Novelties
Sex & Swingers Personals
Free Online Poker
BDSM & Alternative Personals