数据分析师2017-09-30 23:50:20
$( ) uses single quotes for a while, and double quotes for a while. Ask the master to explain to me why? - PHP Chinese website Q&A - $( ) uses single quotes for a while, and double quotes for a while. Ask the master to explain to me. Explain why you are here? - PHP Chinese website Q&A
Take a look around and learn.
阿神2017-01-04 16:14:26
单引号和双引号其实没啥区别,看你自己习惯了
<input type="button" onclick="alert("1")">-------------------不正确
<input type="button" onclick="alert('1')">-------------------正确
双引号中再用双引号要这样:
var str = "abc\"def\"ghi"
用反斜杠来禁止解析双引号。
如果单独用的话,如alert('test')和alert("test")两个根本没区别。