How to use 'ajax content type' in JavaScript

Every line of 'ajax content type' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
111function getResponseType(contentType) {
112 if (contentType === undefined) {
113 return null;
114 }
115
116 if (contentType.indexOf('xml') !== -1) {
117 return 'xml';
118 }
119
120 if (contentType.indexOf('html') !== -1) {
121 return 'html';
122 }
123
124 return contentType;
125}

Related snippets