SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Jul 7, 2006, 07:53 #1
- Join Date
- Jan 2004
- Location
- London
- Posts
- 226
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
method not being passed ajax request results
I wrote a small script which was a bit messy, a simple autocomplete thing. I decided to rewrite it as a javascript object, but now the results from my ajax call are not being passed to the handler method... I can't work out why. This is a brief overview of what I have now:
Code:var aC = { addEvent: function() {...}, init: function() { aC.search = document.getElementById('search'); aC.addEvent(aC.search, 'keyup', aC.doLookup, false); }, doLookup: function() { var qs = '?search=' + aC.search.value; var xmlhttp = new Ajax(); xmlhttp.doGet('check.php' + qs, aC.handleLookup); }, handleLookup: function(str) { alert(str.value); }, search: ''; }; aC.addEvent(window, 'load', aC.init, false);
thanksInternational calls from the UK
Cheap International Calls
-
Jul 8, 2006, 09:32 #2
- Join Date
- Nov 2001
- Location
- Bath, UK
- Posts
- 2,498
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The obvious question is: does addEvent work? What does it look like? What do doGet and Ajax look like?
Need more infoHello World
Bookmarks