In my server application (on Parse Cloud Code), I want save some string data. There are HTML entities here, which I want to encode.
So i find a solution with Javascript:
var txt = document.createElement("textarea");
txt.innerHTML = html;
return txt.value;
This code work perfectly on html pages, where document
exists. But there isn't such variable on server.
How can i declare document variable? Or maybe you know another solutions for encoding HTML entities.