Escape quotes in JavaScript

前端 未结 13 875
不思量自难忘°
不思量自难忘° 2020-11-22 11:39

I\'m outputting values from a database (it isn\'t really open to public entry, but it is open to entry by a user at the company -- meaning, I\'m not worried about XSS).

13条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 12:04

    Escape whitespace as well. It sounds to me like Firefox is assuming three arguments instead of one.   is the non-breaking space character. Even if it's not the whole problem, it may still be a good idea.

提交回复
热议问题