Campaign: JSSPs not returning proper character encoding
Description description
Environment
- Campaign Classic
- Campaign
Issue/Symptoms
Sometimes within the header ContentType
an error is thrown as it has not been properly defined. When using JSSPs that the content type is not returning application/json; charset=utf-8
.
Resolution resolution
To fix this, add ContentType
in JavaScript before the rest of the code is executed.
%
response.setContentType("text/html;charset=utf-8");
%
or
%
response.setContentType('application/json;charset=utf-8");
%
Sample
%
response.setContentType('application/json');
var x = {'Element1':'Element2'};
document.write(JSON.stringify(x));
%
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f