jQuery中的单引号或双引号
问题描述:
可能重复:
何时在JavaScript中使用双引号或单引号
这是专门针对jQuery而不是JavaScript,因为我不是JavaScript程序员而且我开始学习jQuery。
This is specifically for jQuery not JavaScript in general since I'm not a JavaScript programmer and I'm starting to learn jQuery.
随着发布jQuery 1.6是否有使用单引号或双引号的特定更改?
With the release of jQuery 1.6 was there a specific change on using single or double quotes?
例如,以下函数是否可以在jQuery 1.6中运行?:
For example, would the following function work in jQuery 1.6?:
$('.selector').show();
或者我是否必须使用双引号?:
Or do I have to use double quotes?:
$(".selector").show();
提前感谢任何澄清。
答
字符串应始终使用双引号而不是单引号。
"Strings should always use double-quotes instead of single-quotes."