var txt="We are the so-called \"Vikings\" from the north."
var txt2="We are the so-called "Vikings" from the north."
document.write(txt2)
上面两种效果一样,那这两种有什么区别?
var txt="We are the so-called \"Vikings\" from the north."
var txt2="We are the so-called "Vikings" from the north."
document.write(txt2)
上面两种效果一样,那这两种有什么区别?
10 回答11.1k 阅读
6 回答3k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.7k 阅读✓ 已解决
3 回答1.4k 阅读✓ 已解决
3 回答2.3k 阅读✓ 已解决
把第一个字符串插入到HTML中时,插入的实际字符串是
反斜杠被JavaScript转义
第二个插入的是
在显示的时候浏览器会转义第二个字符串中的
"