Created
December 14, 2009 00:42
-
-
Save ericf/255698 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_onSuccess : function (txId, r, args) { | |
var entity = r.responseText; | |
if (entity && entity.length > 0) { | |
try { | |
entity = Y.JSON.parse(entity); | |
} catch (e) {} | |
} | |
if (Y.Lang.isObject(entity) || Y.Lang.isArray(entity) { | |
// successful JSON parse | |
} else if (Y.Lang.isString(entity) { | |
// doesn't look like we could parse the responseText as JSON, but we still have a String to work with | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment