posted 11 years ago
the code above, just put into a file and save as AJAXLib.js
In the <head></head> of your html file just put:
<script type = "text/javascript" src = "directory/AJAXLib.js"></script>
now in a function that you call on onKeyUp, we'll call it autoComplete(this.value).
So the tag would look like <input type="Text" onclick="autoComplete(this.value)" />
and...
The reason you have to make a callBackFunction is because when you make an ajax request, the response doesn't happen right away so you have to make a callbackfunction to handle the event when the response is ready to be dealt with.
Justin
You down with OOP? Yeah you know me!