src/js/libs/spiritual-gui.js
function(text) {
			var result = text;
			try {
				switch (this._headers.Accept) {
					case "application/json":
						result = JSON.parse(text);
						break;
					case "text/xml":
						result = new DOMParser().parseFromString(text, "text/xml");
						break;
				}
			} catch (exception) {
				if (gui.debug) {
					console.error(
						this._headers.Accept + " dysfunction at " + this._url
					);
				}
			}
			return result;
		}
function(text) {
			var result = text;
			try {
				switch (this._headers.Accept) {
					case "application/json":
						result = JSON.parse(text);
						break;
					case "text/xml":
						result = new DOMParser().parseFromString(text, "text/xml");
						break;
				}
			} catch (exception) {
				if (gui.debug) {
					console.error(
						this._headers.Accept + " dysfunction at " + this._url
					);
				}
			}
			return result;
		}
function ( text ) { var result = text ; try { switch ( this . _headers . Accept ) { case "application/json" : result = JSON . parse ( text ) ; break ; case "text/xml" : result = new DOMParser ( ) . parseFromString ( text , "text/xml" ) ; break ; } } catch ( exception ) { if ( gui . debug ) { console . error ( this . _headers . Accept + " dysfunction at " + this . _url ) ; } } return result ; }
Parse response to expected type.
@param {String} text
@returns {object}
Parse response to expected type .