I have the following:
var text = "Übergroße Äpfel mit Würmern";
I'm searching for a Javascript function to transform the text so that every special letter is represented by its HTML entity sequence like this:
var newText = magicFunction(text);
...
newText = "Übergroße Äpfel mit Würmern";
The function should not only escape the letters of this example but also all of these.
How would you achieve that? Is there any existing function out there? (Plain, because a solution without a framework is preferred)
Btw: Yes, I've seen this question but it doesn't address my need.