$( )里一会儿用单引号,一会儿用双引号 请求大神给我解释一下为啥来的?
phpcn_u226
phpcn_u226 2017-01-04 16:14:06
0
2
1349

如题

phpcn_u226
phpcn_u226

reply all(2)
数据分析师

$( ) 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.

阿神

单引号和双引号其实没啥区别,看你自己习惯了

<input type="button" onclick="alert("1")">-------------------不正确
<input type="button" onclick="alert('1')">-------------------正确

双引号中再用双引号要这样:
var str = "abc\"def\"ghi"
用反斜杠来禁止解析双引号。

如果单独用的话,如alert('test')和alert("test")两个根本没区别。

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template