I have an application that ajax reads a MySQL database, which contains a normal (non-escaped) content with several words in double quotes, single or single quotes.
This content goes to a variable, eg:
conteúdo que está no banco de dados...= Quantos litros d'água está "sujo"
wVar = conteúdo acima
I have to display this concatenating with another text, type:
alert("texto = "+wVar);
It's how I wanted to display "texto = "+"Quantos litros d'água está "sujo""
There is an error, logically because the double quotation marks of the word "dirty" is not escaped.
How can I display these phrases correctly without knowing exactly what content will be loaded from the database in the variable?
NOTE: In the view the word "dirty" needs to be displayed with the double quotes as it is part of the correct content of the text.