File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue regarding a basic AJAX project

 
Rahul Bukkarayasamudram
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:




 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using Firebug in Firefox or some other tool to monitor the request and response?

it will show you what's being sent and returned so you can try to narrow down where any problem lies.
 
Rahul Bukkarayasamudram
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I appreciate your response. I have not used Firebug till now. I will try to play around with it.

Just by the way, this is my source:

http://java.sun.com/developer/technicalArticles/J2EE/AJAX/

- Rahul
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic