473,385 Members | 1,396 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,385 software developers and data experts.

Difference between " and '

Hi

I have used JS for years, still I dont know this. I know the
difference in php but not in js.

window.open('page.htm'); and window.open("page.htm"); - what is the
difference?

/S
Dec 28 '07 #1
7 1571
On Dec 28, 1:57 pm, jodleren <sonn...@hot.eewrote:
Hi

I have used JS for years, still I dont know this. I know the
difference in php but not in js.

window.open('page.htm'); and window.open("page.htm"); - what is the
difference?

/S
None :-)
In JavaScript it doesn't matter whether you use single or double
quotes.
Dec 28 '07 #2
Response to jodleren <so*****@hot.ee>:
I have used JS for years, still I dont know this. I know the
difference in php but not in js.

window.open('page.htm'); and window.open("page.htm"); - what is the
difference?
JavaScript doesn't care.

window.alert('a\nb');
window.alert("a\nb");
--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Dec 28 '07 #3
jodleren said the following on 12/28/2007 8:57 AM:
Hi

I have used JS for years, still I dont know this. I know the
difference in php but not in js.

window.open('page.htm'); and window.open("page.htm"); - what is the
difference?
None, as long as you escape them when you nest them.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 28 '07 #4
On 28 dic, 05:57, jodleren <sonn...@hot.eewrote:
Hi

I have used JS for years, still I dont know this. I know the
difference in php but not in js.

window.open('page.htm'); and window.open("page.htm"); - what is the
difference?
There is no real difference but using single quotation marks is a bit
more convenient when writing an HTML string. Single quotation marks
save needing to escape attribute double quotation marks.

'<div id="myDiv">asdf</div>'

vs.

"<div id=\"myDiv\">asdf</div>"

Peter
Dec 28 '07 #5
Peter Michaux wrote on 28 dec 2007 in comp.lang.javascript:
On 28 dic, 05:57, jodleren <sonn...@hot.eewrote:
>Hi

I have used JS for years, still I dont know this. I know the
difference in php but not in js.

window.open('page.htm'); and window.open("page.htm"); - what is the
difference?

There is no real difference but using single quotation marks is a bit
more convenient when writing an HTML string.
Not at all!
Single quotation marks
save needing to escape attribute double quotation marks.

'<div id="myDiv">asdf</div>'

vs.

"<div id=\"myDiv\">asdf</div>"
Eh? try:

'<div id="myDiv">asdf</div>'

vs.

"<div id='myDiv'>asdf</div>"

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 28 '07 #6
Peter Michaux wrote:
On 28 dic, 05:57, jodleren <sonn...@hot.eewrote:
>I have used JS for years, still I dont know this. I know the
difference in php but not in js.

window.open('page.htm'); and window.open("page.htm"); - what is the
difference?

There is no real difference but using single quotation marks is a bit
more convenient when writing an HTML string. Single quotation marks
save needing to escape attribute double quotation marks.

'<div id="myDiv">asdf</div>'

vs.

"<div id=\"myDiv\">asdf</div>"
vs.

"<div id='myDiv'>asdf</div>"

:)
PointedEars
--
"Use any version of Microsoft Frontpage to create your site. (This won't
prevent people from viewing your source, but no one will want to steal it.)"
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Dec 28 '07 #7
In comp.lang.javascript message <9a809e27-5273-48d4-8623-c55b0708c4f0@e2
3g2000prf.googlegroups.com>, Fri, 28 Dec 2007 09:26:49, Peter Michaux
<pe**********@gmail.composted:
>
There is no real difference but using single quotation marks is a bit
more convenient when writing an HTML string.
IMHO, with a UK keyboard and my eyes, ' is better for writing a string
but " is better for reading one.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demon.co.uk/clpb-faq.txt RAH Prins : c.l.p.b mFAQ;
<URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zipTimo Salmi's Turbo Pascal FAQ.
Dec 29 '07 #8

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

Similar topics

3
by: Giulio | last post by:
I'm studying Craig Larman's "Applying uml and Patterns" (third ed.) reading at the book it seems (16.6) that Operations and Methods in a Class diagram are something different but it's not...
6
by: XiongBin | last post by:
anybody who tell me: what is the difference between "struct" and "class"? :-)
5
by: Bob | last post by:
Are they different names for the same concept ?
2
by: Keith Smith | last post by:
What is the difference between "build" and "rebuild" when building a project?
5
by: Agnes | last post by:
For my own practices. I like to put "Me". e.g IF Me.txtInvoice.textlength = 0 ....... etc Me.txt.....etc However, Is there any difference (without Me) ?? Thanks
6
by: John Pass | last post by:
What is the difference between a While and Do While/Loop repetition structure. If they is no difference (as it seems) why do both exist?
1
by: tankbattle | last post by:
That is, what's the difference between <complexType name="Address" final="restriction"> <sequence> <element name="name" type="string"/> <element name="street" type="string"/> <element...
3
by: Bsr | last post by:
What is the difference between for the following methods. "GET", "HEAD", "PUT" or "POST". Ex:my $req =HTTP::Request->new(GET =>$url1); Bhuvan.
6
by: =?Utf-8?B?SmVmZg==?= | last post by:
I thought this would already be covered here, but my search turned up nothing. In VS2005, if I use "String" to define a new variable/class, it colors it in the Aqua color as it does other...
4
by: msukumarbabu | last post by:
Hi all, What will be difference between "typedef enum" and "enum". or difference between “typedef structure" and "structure" I am going through some code. in that some place they are using...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.