Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > AJAX

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

AJAX Web based language that allows asynchronous loading of pages that does not interfere with normal page loading.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-29-2007, 08:26 AM
plits plits is offline
Newbie
 
Join Date: Nov 2006
Posts: 3
Credits: 0
Rep Power: 0
plits is on a distinguished road
Default responseXML returns null

I created my first AJAX application and everything was going great when I used responseText to retrieve my data.

I decided to switch to XML output and now I receive "Object Null" error when I alert my output. When I change it back to responseText I can see the XML output.

Can someone tell me what is wrong?

JavaScript Code:
  1. function stateChanged()
  2. {
  3.   if ((xmlRT.readyState==4)&&(xmlRT.status == 200))
  4.   {
  5.     var xmlobj=xmlRT.responseXML;
  6.     alert(xmlobj);
  7.    }
  8. }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 10-30-2007, 06:48 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 7,330
Last Blog:
Tramp Variables
Credits: 1
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

There can be several reasons for this but one of the most common is that the content you are reading is not set to text/html.

In PHP you set it:
php Code:
  1. header("Content-type: text/xml");

An easy way to tell is to load your output into your browser. It should appear in XML format (with a tree like structure) and not just plain text.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing applications and CMD commands from C++ N00bDaan C and C++ 3 07-03-2007 12:51 PM
null exception problem connor7777 C# Programming 2 03-28-2007 11:37 AM
Object is Null Lop C# Programming 2 09-21-2006 11:25 AM
Best way to check if an object is null? dirkfirst Managed C++ 0 08-01-2006 07:29 AM
Check object for null Lop C# Programming 3 07-18-2006 05:56 AM


All times are GMT -5. The time now is 01:47 AM.

Contest Stats

Xav ........ 1322.18
MeTh0Dz|Reb0rn ........ 1053.7
morefood2001 ........ 879.43
John ........ 877.37
marwex89 ........ 869.98
WingedPanther ........ 830.24
Brandon W ........ 735.07
chili5 ........ 309.39
Steve.L ........ 239.84
dcs ........ 216.02

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 82%

Ads