473,324 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

quotation mark or apostrophe

Hi,
which of the following two codes is correct and where is the correct
notation standardized:

a) alert("Hello World");

b) alert('Hello World');

Thanx
Stefan

May 3 '06 #1
4 2089
Ca**********@gmx.de wrote:
Hi,
which of the following two codes is correct and where is the correct
notation standardized:

a) alert("Hello World");

b) alert('Hello World');

Either.

--
Ian Collins.
May 3 '06 #2
Ca**********@gmx.de said the following on 5/3/2006 5:47 AM:
Hi,
which of the following two codes is correct and where is the correct
notation standardized:


Both are "correct" technically.

As for being standardized, it isn't. Typically though use ' in JS and
leave " for HTML. It makes escaping a lot simpler.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 3 '06 #3
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.'
May 3 '06 #4
Thanx.

May 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Garrett | last post by:
Hi, I've created a table in SQL Server 2000 and I'm now trying to search through the data and return specific rows. I'm using this command: select * from Export where libelle_court='Recherche...
63
by: Tristan Miller | last post by:
Greetings. Do any popular browsers correctly support <q>, at least for Western languages? I've noticed that Mozilla uses the standard English double-quote character, ", regardless of the lang...
4
by: Thomas Miskiewicz | last post by:
Hi! Is using of a double quotation mark with a URL a problem? For example: http://myserver.com/query?field1=something&field2=test&params="field1=test1"+"field2=test2" Regards Thomas
3
by: James Foreman | last post by:
I've got a set of emails in a table, where sometimes they've failed to input the @ properly. Eg james.foreman'abcmail.co.uk How do I write a replace to deal with that? Also, I've got a set...
4
by: | last post by:
Hi, How do I trim double quotation mark " in a string? Or, how do I match pattern if the string has double quotation mark already like "string"? Thanks in advance. Hugh
9
by: M P | last post by:
Hi! I am looking for a way that I can trap the single quotation mark. If an encoder uses single quotation mark on a textbox field, it always give me an error because I use single quotes on the...
9
by: dajava | last post by:
Hi, Sorry for this beginner's question. I do not know PHP and write for my friend. He has never been a professional programmer. He studied C and PHP with some books and made a bulletin...
31
by: The Bicycling Guitarist | last post by:
Hi. For many years I have been using &quot; for double quotation marks in the HTML code, but the opening and closing quotation marks render the same in my browser. I'm considering going through and...
1
by: U Aye Thein | last post by:
I found in internet how to solve single quotation mark in string and how to solve double quotation mark in string but my string may be contained single quote or double quote. How to write an...
3
by: Royan | last post by:
Difference between quotation and apostrophe in PHP I wonder is there any difference between strings wrapped into quotation marks or into apostrophes and if so is there any situation when one is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.