KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In my $.ajaxSucess() function I need to find out if the response is json. Currently I am doing this: $('body').ajaxSuccess(function(evt, xhr, settings) { var contType = xhr.getAllResponseHeaders().match(/Content-Type: *([^)]+);/); if(contType && contType.length == 2 && contType[1].toLowerCase() == 'application/json'){ ... Is there a better way?
Tags (comma-separated)
Save Edits
Cancel