473,471 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Linking to other web pages

Hi,

What's the difference between using <a href="/foldername/otherpage.html">
(double quotes) and <a href='/foldername/otherpage.html'>(single quotes)?

Thanks,
J. Christopher
Jul 20 '05 #1
11 1683
"J. Christopher Miller" <th*******@earthlink.net> wrote in
news:M5*****************@newsread2.news.pas.earthl ink.net:
Hi,

What's the difference between using <a href="/foldername/otherpage.html">
(double quotes) and <a href='/foldername/otherpage.html'>(single quotes)?


None whatsoever. You can use either type of quote around attribute values
(as long as both the opening and closing quote are the same type). That's
so that if, for some reason, the attribute value has to contain a quote
character of one type, you can use the other type to surround it (note that
it's a good idea to quote all attribute values; in XHTML you have no choice
but to do so; in HTML there are a few circumstances where you can omit the
quotes, but they're not worth memorizing).
Jul 20 '05 #2

"Eric Bohlman" <eb******@earthlink.net> wrote in message
news:Xn******************************@130.133.1.4. ..
"J. Christopher Miller" <th*******@earthlink.net> wrote in
news:M5*****************@newsread2.news.pas.earthl ink.net:
Hi,

What's the difference between using <a href="/foldername/otherpage.html"> (double quotes) and <a href='/foldername/otherpage.html'>(single
quotes)?
None whatsoever. You can use either type of quote around attribute values
(as long as both the opening and closing quote are the same type). That's
so that if, for some reason, the attribute value has to contain a quote
character of one type, you can use the other type to surround it


.... though that's for sheer convenience, since you can also just substitute
an entity reference (&quot;) or a character code.

Jul 20 '05 #3
"Harlan Messinger" <h.*********@comcast.net> schrieb im Newsbeitrag
news:c2*************@ID-114100.news.uni-berlin.de...

"Eric Bohlman" <eb******@earthlink.net> wrote in message
news:Xn******************************@130.133.1.4. ..
"J. Christopher Miller" <th*******@earthlink.net> wrote in
news:M5*****************@newsread2.news.pas.earthl ink.net:
Hi,

What's the difference between using <a href="/foldername/otherpage.html"> (double quotes) and <a href='/foldername/otherpage.html'>(single quotes)?

None whatsoever. You can use either type of quote around attribute
values (as long as both the opening and closing quote are the same type). That's so that if, for some reason, the attribute value has to contain a quote
character of one type, you can use the other type to surround it


... though that's for sheer convenience, since you can also just

substitute an entity reference (&quot;) or a character code.


Sometimes you need quotes inside attribute values, for example if you call a
javascript function with an argument in an event handler. Of course you
could also escape them with a backslash, so you are still right and it is an
issue of convenience.

--
Markus
Jul 20 '05 #4

"Markus Ernst" <derernst@NO#SP#AMgmx.ch> wrote in message
news:40***********************@news.easynet.ch...
"Harlan Messinger" <h.*********@comcast.net> schrieb im Newsbeitrag
news:c2*************@ID-114100.news.uni-berlin.de...

"Eric Bohlman" <eb******@earthlink.net> wrote in message
news:Xn******************************@130.133.1.4. ..
"J. Christopher Miller" <th*******@earthlink.net> wrote in
news:M5*****************@newsread2.news.pas.earthl ink.net:

> Hi,
>
> What's the difference between using <a href="/foldername/otherpage.html">
> (double quotes) and <a href='/foldername/otherpage.html'>(single

quotes)?

None whatsoever. You can use either type of quote around attribute values (as long as both the opening and closing quote are the same type). That's so that if, for some reason, the attribute value has to contain a quote character of one type, you can use the other type to surround it


... though that's for sheer convenience, since you can also just

substitute
an entity reference (&quot;) or a character code.


Sometimes you need quotes inside attribute values, for example if you call

a javascript function with an argument in an event handler. Of course you
could also escape them with a backslash, so you are still right and it is an issue of convenience.


It still works, even with nested Javascript quotes inside a Javascript text
string. See:

http://gavelcade.com/nestedquotes.html

No single quotes are used, the first level of nested double quotes appears
as &quot;, and the second level as \&quot;, with the Javascript \ escape.

Jul 20 '05 #5
Eric Bohlman wrote:
in HTML there are a few circumstances where you can omit the
quotes, but they're not worth memorizing).


I have a very simple system...

Quote alphanumeric values, leave numeric values unquoted.

That's perhaps from my background as a programmer, but I have no problem
whatsoever in remembering this distinction between strings and numbers...
Jul 20 '05 #6
Tim
Eric Bohlman wrote:
in HTML there are a few circumstances where you can omit the
quotes, but they're not worth memorizing).


"Keld R. Hansen" <ne**@www.heartware.dk> posted:
I have a very simple system...

Quote alphanumeric values, leave numeric values unquoted.


So far as I'm aware, something like 45% has to be quoted, and that's a
numerical value.

My system is simpler; quote everything. ;-)

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
Jul 20 '05 #7
Tim <ti*@mail.localhost.invalid> wrote:
So far as I'm aware, something like 45% has to be quoted, and
that's a numerical value.
Not to mention +1. To confuse those who don't quote, -1 doesn't need to
be quoted. Besides, #000000 is a numerical value too, in a sense.
My system is simpler; quote everything. ;-)


Right. When in doubt, quote. And when not in doubt, quote.

Just remember to stop routinely quoting when you move to CSS, which has
its own rules (e.g., in font-family, "serif" is not the same as serif).

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #8
Tim wrote:
I have a very simple system...

Quote alphanumeric values, leave numeric values unquoted.
So far as I'm aware, something like 45% has to be quoted, and that's a
numerical value.


"%" is not a numeric character, therefore "45%" is not a numeric value
(as I - as a programmer - understand it). Therefore "45%" is an
alphanumeric value, and therefore it is quoted :).
My system is simpler; quote everything. ;-)


And waste a lot of bytes in the process :-).

--
Keld R. Hansen
http://index.epguides.info

(To reply by email, remove the WorldWideWeb prefix from the domain name)
Jul 20 '05 #9
On Fri, 05 Mar 2004 10:25:16 +0100, "Keld R. Hansen"
<ne**@www.heartware.dk> wrote:
Eric Bohlman wrote:
in HTML there are a few circumstances where you can omit the
quotes, but they're not worth memorizing).


I have a very simple system...

Quote alphanumeric values, leave numeric values unquoted.

That's perhaps from my background as a programmer, but I have no problem
whatsoever in remembering this distinction between strings and numbers...


Except that in this case the distinction doesn't exist! The characters
where you can omit the quotes are all the alphanumerics, plus a couple
of others that I never bother to remember.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #10
Tim
Unattributed sources wrote:
I have a very simple system...

Quote alphanumeric values, leave numeric values unquoted.


Tim wrote:
So far as I'm aware, something like 45% has to be quoted, and that's a
numerical value.

"Keld R. Hansen" <ne**@www.heartware.dk> posted:
"%" is not a numeric character, therefore "45%" is not a numeric value
(as I - as a programmer - understand it). Therefore "45%" is an
alphanumeric value, and therefore it is quoted :).
It *is* a "numerical value," it happens to use alphanumerical characters
though. There's a difference in semantics. Forty-five percent is a
"numerical value," you just didn't describe your rule situation very good
in the first place (as a programmer, you should understand that). ;-)

Anyone else being told there's no need to quote "numerical values" would,
quite easily, believe that they didn't have to quote any numerical value.
And based on the advice, it wouldn't be their fault.
My system is simpler; quote everything. ;-)

And waste a lot of bytes in the process :-).


I wouldn't consider it a significant number.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
Jul 20 '05 #11
Tim wrote:
So far as I'm aware, something like 45% has to be quoted, and that's a
numerical value.

"%" is not a numeric character, therefore "45%" is not a numeric value
(as I - as a programmer - understand it). Therefore "45%" is an
alphanumeric value, and therefore it is quoted :).

It *is* a "numerical value," it happens to use alphanumerical characters
though. There's a difference in semantics. Forty-five percent is a
"numerical value," you just didn't describe your rule situation very good
in the first place (as a programmer, you should understand that). ;-)


As a *programmer*, 45% is *not* a numerical value. I don't know of any
programming language that allows me to write "A=45%" as a stand-alone
statement without the compiler complaining about it :-).

Now, as a *mathematician*, I agree with you, that 45% is a numerical
value (equal to 0.45), but I specifically stated, that I meant a
numerical value as expected by me as a *programmer* :-).

Anyway, my system works. Any value consisting of the characters "0"-"9"
(ASCII values 48-57, or 0x30-0x39) is left unquoted. Anything else is
quoted.

And before you start including decimal points in the discussion: I have
yet to see an attribute value capable of expressing a numerical,
fractional value (what - I can't specify an image as being 50.34 pixels
wide? ;-))

Keld R. Hansen
http://startrek.epguides.info
Jul 20 '05 #12

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

Similar topics

27
by: Lee Phillips | last post by:
I believe it is universally accepted that decorating your website with images from someone else's, without permission, is rude and unethical, even if the images are in the public domain, because...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
33
by: randau | last post by:
Linking to a Targeted Browser Window I'd like to open reference links to other web sites in a separate browser window from the browser window hosting my own web site pages. The Link Target...
3
by: Ken | last post by:
I have a win 2000 database of autographs and scanned photos. They are in the SAME directory. In the table, my "ImagePath" text field shows JUST the image name (i.e. "blank.jpg"). I have an image...
14
by: diskoduro | last post by:
Hi!! Years ago I built a database to control the production of a little factory. The users wanted to work in a Windows Net workgroup so I created an mdb with all the tables and data an after...
0
by: gasturbtec | last post by:
please help im new at access programming and i just got this project dropped in my lap because the old programmer quit. i've been doing ok so far but now i need to add code to an existing database...
10
by: Julian | last post by:
I get the following error when i try to link a fortran library to a c++ code in .NET 2005. LINK : fatal error LNK1104: cannot open file 'libc.lib' the code was working fine when built using...
1
by: clarke187 | last post by:
I have a website that exchanges links for ads. is there a robot i can use to see if they really are, without having to do it manually. I run mac OSx thanks
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
4
by: naveenmurthy | last post by:
Hello All, I have created a .mht file in following format. 1. The .mht file contains following htmls. a. MHTLinkingProblem.html b. Left.html c. Right.html d. Start.html
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
muto222
php
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.