This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
responseString = The responseString is actually one long string. I added the formatting below for readability
The intention is to set a callback function to be called asynchronously by browser.
But due to the parentheses, what this actually does is make a function call immediately to gotInventoryCallback()
(which is why you don't see the alert in that function), and then assign its return value (null value) to req.onreadystatechange, which is meaningless.
The correct code should be
This is the one I could spot, but I didn't go through your XML implementation in detail. Try out this correction and if there are further problems, ask away on this thread.
Also, IMO, you should stop using the raw XMLHttpRequest API and start with jquery (it's not the only one out there, but it's good to start with). It helps write much more compact, readable, cross-browser error free code.
In jquery, this would have been
Joined: Aug 31, 2011
Now, you said
Maybe playing piano with welding gloves is good music.
subject: AJAX script isn't parsing XML response from servlet