Skip to content Skip to sidebar Skip to footer

Xml Retrieval With Ajax Returning [document Object], How Do I Get The Content?

I asked a question similar to this yesterday, but have since made progress on the problem. Now, all that stands in my way is figuring out how to turn this success response into som

Solution 1:

It's better to use console.log then alert, like that :

$.ajax({
  type: "GET",
  url: "https://www.mychoicetechnologies.com/Services/FMSUtilities.asmx/GetServerDate",
  data: "{}",
  contentType: "application/xml; charset=utf-8", 
  success: function (msg) 
  {     

     document.getElementById('area').innerHTML = "Success! Retrieved a server response using AJAX.<br>";
     console.log(msg);
  },
  error: function (xhr, status, error)
  {        
     document.getElementById('area').innerHTML =  "1." + error +   "<br>";
     document.getElementById('area').innerHTML += "2." + xhr +     "<br>";
     document.getElementById('area').innerHTML += "3." + status +  "<br>";
     document.getElementById('area').innerHTML +=           "The script has failed.";
  }
});

If you use Google Chrome, use the shortcut "ctrl + shift + j", and retry you query.

Post a Comment for "Xml Retrieval With Ajax Returning [document Object], How Do I Get The Content?"