I heard somewhere that its better to write this:
$(document).ready(function() {
$('a').append('<strong>Hello</strong>');
});
instead of this:
$(document).ready(function() {
$("a").append("<strong>Hello</strong>");
});
But the last one, is the way that its written in the official documentation of jQuery.
So which gives more problems when the code gets larger? single (‘) or double (“) quotation?
or its irrelevant?
In javascript, it is irrelevant. Both mean the same thing.
You may have heard the advice form languages like Perl where “” means interpolated string and ” means string literal. In which case ” incurs less processing overhead.
In javascript there are two ways to quote strings to allow simple shallow nesting of quotes: