Ca**********@gmx.de writes:
which of the following two codes is correct and where is the correct
notation standardized:
a) alert("Hello World");
b) alert('Hello World');
Both are correct. String literals in ECMAScript/Javascript can be
surrounded by either single or double quotes, as long as they
match.
This is specified in the ECMAScript standard:
<URL:http://www.ecma-international.org/publications/standards/Ecma-262.htm>
and also in the specifications of the ECMAScript compliant languages
javascript
: <URL:http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Literals#String_Literals >
and JScript: <URL:http://msdn.microsoft.com/library/en-us/script56/html/c7a6bd3a-4b1c-4dbe-8505-106dbf483b41.asp>
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'