Possible Duplicate:
When to Use Double or Single Quotes in JavaScript
Hello,
Do "" and '' have different meanings in JavaScript? Because I keep seeing those two usages in Jquery, for instance.
$("")
and
$('')
Thanks for helping
Possible Duplicate:
When to Use Double or Single Quotes in JavaScript
Hello,
Do "" and '' have different meanings in JavaScript? Because I keep seeing those two usages in Jquery, for instance.
$("")
and
$('')
Thanks for helping
There is no difference between '' and "", they both represent empty strings.
Read about strings in JavaScript. There is no difference.
But as HTML properties are often defined with double-quotes, I would use single-quotes, which makes code like
$('<a href="someurl" />')
easier to write.
Use the one with which you have less characters to escape inside the string.
No, they mean the same thing; they are both just JavaScript string literals. It is convenient to have two different quotes so you can nest them without having to use escape sequences; "some string with 'single quotes' in it" or 'a string with "double quotes" in it'.
They both are string delimiters. The only difference is if you can use " to enclose a string with ' in it, and you can use ' to enclose a string with " in it.
You can use either. I recommend sticking to one standard though throughout your project, things can sometimes get a little messy when interchanging between them when combining with server side code.
No... since isn't possible use "" inside "", the "" and '' make a good combination when need quote a string inside another.