• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Issue regarding a basic AJAX project

 
Greenhorn
Posts: 5
  • 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:




 
Marshal
Posts: 67447
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
  • 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
 
    Bookmark Topic Watch Topic
  • New Topic