Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with AJAX script

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic