qAnswersR[90430] = [];
qAnswersR[90430].push("[math]k: \frac{(x+20)^{2}}{256}+\frac{(y-15)^{2}}{81}=1[/math]");
,我需要得到的价值为可变的,但是当我CONSOLE.LOG出数组是这样的:如何让JavaScript忽略转义()字符?
console.log(qAnswersR[90430]);
我得到:[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]
但逃生标签"\"
消失,但我需要它,我该怎么办?
好了THX,你认为这将是在PHP这样做的最好的功能?因为脚本是在PHP中生成的。 (addslashes?) – Mike 2011-05-31 07:49:53
看看这个问题:http://stackoverflow.com/questions/168214/pass-a-php-string-to-a-javascript-variable-including-escaping-newlines – aioobe 2011-05-31 07:58:08