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
this disclaimer
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}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code


Related snippets