handle when browser returns json in a <pre> (yeah, srsly)

This commit is contained in:
John Bintz 2012-03-16 10:53:28 -04:00
parent 2066effe5d
commit 3289a91a84

View File

@ -100,6 +100,12 @@ jQuery.extend({
if ( status != "error" ) if ( status != "error" )
{ {
// process the data (runs the xml through httpData regardless of callback) // process the data (runs the xml through httpData regardless of callback)
if ($('pre', xml.responseText)) {
var $doc = $("<div />").append(xml.responseText);
xml = { responseText: $doc.find('pre').get(0).innerHTML};
}
var data = jQuery.uploadHttpData( xml, s.dataType ); var data = jQuery.uploadHttpData( xml, s.dataType );
// If a local callback was specified, fire it and pass it the data // If a local callback was specified, fire it and pass it the data
if ( s.success ) if ( s.success )