-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.0.6 API] JSON Response Parameter does not follow DataType Specified #2713
Comments
onFailure pulls the response object from In the case of a real XHR it looks like Fix incoming |
Your example should now be fixed. |
Thanks for the quick fix. ^o^ I'll keep using my JSON Parse workaround until the bug fix is in stable. Just as a follow up... did you check to see if the onComplete() gives the proper response, as in the fiddle, when the successTest fails... it appears to return the full xhr, instead of a parsed xhr.responseText. |
👍 Just thought about this and were about to open an issue :). Semantic is awesome! |
Thanks, it's clear to me now the inconsistencies between responses. I've also added a third parameter Example of fixed with success response With failure response |
=D! |
Hellos~
When using the API Feature and routing through $.fn.api.settings.successTest, the onComplete() & onFailure() json response param does not match the datatype specified (tested for json).
To explain further... when the successTest fails, the onFailure() json response is a textual json string and not in object notation. Also, onComplete() json response is a parent object instead of the expected ajax response object.
Conversely, when successTest succeeds, the onComplete() and onSuccess() json response is in the expected object notation.
Also, this issue required me to use fiddle's /echo/ ajax service, as using SUI's built-in mock feature, gives the correct object notation in all cases. I'm thinking this is an issue in the coding related specifically to the ajax handler. (wild guess ^o^;;).
FYI. Example displays output to console...
Fiddle: http://jsfiddle.net/Airforce111/sv13cujv/
For reference...
The text was updated successfully, but these errors were encountered: