The reason it is returning "contenthsgjhome.css"
is that your string doesn t really have any backslashes in it at all because single backslashes in a string literal will be ignored unless they make sense to escape the following character (e.g., "\"
or "
"
). "c"
has no special meaning as an escape so it is interpreted as "c"
.
"contenthsgjhome.css"
结局与:
"contenthsgjhome.css"
因此, . replace ()
找不到反斜线 。
(请注意,如果您 do 以字串字串形式(如 \\"
,该字串仅是字面语法的一部分,一旦被解释,所产生的字符串只有一个反斜线 ""
),则该字串的反斜线(注意) 。)
或许你可以解释一下你所说的“只是FS的产出”的意思。当JSP/ASP/PHP/etc 输出JS代码时,这是一个常见的问题 — — 在JSP/ASP/PHP/etc 代码中,逃跑需要在JSP/ASP/PHP/etc 代码中发生,然后再由JSP/ASP/PHP/etc 的翻译看到。