I'm making an AJAX call to a page that returns XML. It turns out that I need to also return another standalone value, along with the XML.
Here is the JQuery AJAX call:
$.ajax({
type: "GET",
url: "filesearch.asp",
data: "action=getresponse,
dataType: "text",
cache: false,
success: function(data){
var parsed = data.split('DELIMITER');
var xml = data[0];
var myvalue = data[1];
}
The page that sends the response sends the XML and my value separated by the DELIMITER string. Also, I set the dataType so that it treats the full response as a text, and I'm assuming I should be able to simply split the string at the delimiter and access both values in my success function. Firebug shows I get the full response correctly, but when I log xml and myvalue to the console, I get:
xml = <
myvalue = ?
Any ideas what I'm doing wrong or how to troubleshoot?