Hi,
I am a newbie learning AJAX. I have an issue making the code work. I would really appreciate if you could help me out. I did not use External JavaScript files. I have my
servlet and the HTML file.
I am able to call the servlet with the given URL, I have used SOPs on the servlet to see that it is being called. I think the problem is with the response. When I call the 'callback()' function, the status of the req.readystate is never equal to 4.
The alert message informs me that the value is "one". That is reason why I do not proceed any further and cannot call the parseMessage() and setMessage() functions, which receive the request from the servlet and update the HTML.
This is my HTML file:
The code for my servlet is: