I have this code in my program:
res.send('<html><script>window.opener.alert("' + message + '");window.close();</script></html>');
Now... message
is something I cannot really predict, although it does come back from an established API and it SHOULD be ok. However, "should" is just not good enough.
I realise that I have to escape any "
(or it will break the string). However...
- Do I need to escape anything else?
- Is there a ready-to-to function for this?