Re: little Ajax problem
- From: "Laurent Bugnion [MVP]" <galasoft-lb@xxxxxxxxxx>
- Date: Tue, 23 Jan 2007 13:38:05 +0100
Hi,
Patrick.O.Ige wrote:
I have this Ajax script below that returns data ...
I am not sure that you totally understand what you're doing. First, it was really not necessary to post the whole script here. Then, the formatting is really messed up. Finally, executing the script in any debugger (Venkman, Visual Studio, Windows Script Debugger...) would have shown you quite fast what the problem is.
The function showCustomer needs a string as input. When you use the "str" parameter, you do:
url=url+"?employeeID="+str;
However, you call the method with:
showCustomer(document.getElementById('time'));
document.getElementById returns a DOM Node object. When you attempt to use the object as a string, the "toString()" method (which each object inherits from the "Object" class) is called. Since it has not been overriden in the Node class, it simply returns [Object].
Call the method using
showCustomer(document.getElementById('time').value);
The value property is (in this case, and only because "time" is a textfield) a string containing the content of the textfield.
<snip>
HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
.
- Follow-Ups:
- Re: little Ajax problem
- From: Patrick.O.Ige
- Re: little Ajax problem
- References:
- little Ajax problem
- From: Patrick.O.Ige
- little Ajax problem
- Prev by Date: How to search array
- Next by Date: Could not load type 'ABC.Global'. Error
- Previous by thread: little Ajax problem
- Next by thread: Re: little Ajax problem
- Index(es):
Relevant Pages
|