473,805 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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('pa ge.htm'); and window.open("pa ge.htm"); - what is the
difference?

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

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

window.open('pa ge.htm'); and window.open("pa ge.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('pa ge.htm'); and window.open("pa ge.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('pa ge.htm'); and window.open("pa ge.htm"); - what is the
difference?
None, as long as you escape them when you nest them.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript 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.ee wrote:
Hi

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

window.open('pa ge.htm'); and window.open("pa ge.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\">as df</div>"

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

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

window.open('p age.htm'); and window.open("pa ge.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\">as df</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.ee wrote:
>I have used JS for years, still I dont know this. I know the
difference in php but not in js.

window.open('p age.htm'); and window.open("pa ge.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\">as df</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.javas cript message <9a809e27-5273-48d4-8623-c55b0708c4f0@e2
3g2000prf.googl egroups.com>, Fri, 28 Dec 2007 09:26:49, Peter Michaux
<pe**********@g mail.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.demo n.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demo n.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
14751
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 explained what's the difference. I always thought they were the same thing. Do someone knows what's the difference? thanx alot Giulio
6
2406
by: XiongBin | last post by:
anybody who tell me: what is the difference between "struct" and "class"? :-)
5
3698
by: Bob | last post by:
Are they different names for the same concept ?
2
10012
by: Keith Smith | last post by:
What is the difference between "build" and "rebuild" when building a project?
5
1574
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
71984
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
4749
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 name="city" type="string"/> </sequence> </complexType> and <complexType name="Address" block="restriction">
3
18148
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
4596
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 classes. But if I use "string", it colors it in Navy blue as in C# reserved words (e.g. private, void, foreach, etc). What is the diff?
4
171497
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 enum without typedef. In some places they are using typedef before enumeration definition. Kindly provide some reference, for why they are using typedef.
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10607
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10364
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7645
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5541
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4317
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3843
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.