Alex Rivera | Logout

How to make javascript ignore escape ( \ ) character?

Asked 2011-05-31T07:45:36.553
9
qAnswersR[90430] = [];
    qAnswersR[90430].push("[math]k: \frac{(x+20)^{2}}{256}+\frac{(y-15)^{2}}{81}=1[/math]");

And I need to get the value into variable, but when I console.log out the array like this:

console.log(qAnswersR[90430]);

I get: [math]k: rac{(x+20)^{2}}{256}+rac{(y-15)^{2}}{81}=1[/math],[math]k: 81(x+20)^{2}+256(y-15)^{2}=20736[/math]

But the escape tag "\" disappears, but I need it there, what should I do?

Edit
Report

1 Answer

4

Escape the escape character, like \\a.

answered 2011-05-31T07:47:07.740

Your Answer