Just a string. Add ' to it every time there is a single quote.
replace works for the first quote, so you need a tiny regular expression:
replace
str = str.replace(/'/g, "\'");
1.4m articles
1.4m replys
5 comments
57.0k users