aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Help with AJAX script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Help with AJAX script" Watch "Help with AJAX script" New topic
Author

Help with AJAX script

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, I was playing around with an AJAX script located here...

http://developer.apple.com/internet/webcontent/XMLHttpRequestExample/example.html

I just tried to modify some things and instead of using two listboxes, I used one... Here's the code...

ajaxtest.html


and here's my xml file...





I wanted to display each item to the list... But this doesn't seem to happen... Actually... I don't think my script is being called at all! I tried putting alert() functions almost everywhere in my script so that I would know when it's called... Unfortunately... It's not... Any help? Thanks!


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I really did not look at the code, rather busy preparing for the holiday, but you have <script type="text/xml"> which is wrong. You are using JavaScript here, not XML.

Eric
Sanjiv Jivan
Ranch Hand

Joined: Nov 03, 2005
Posts: 52
Also make sure that your server returns the (XML) content with content type text/xml or else the browser parser will return null for req.responseXML

For any such issues I simply use the IE Javascript debugger. Helps me resolve issues in a matter of minutes.

Sanjiv
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with AJAX script
 
Similar Threads
Please help me analyze this script
onKeyPress
to get the key pressed 2
how to catch keyboard scrolling buttons event?
Get the ID of an element clicked on