
July 20th, 2005, 06:54 PM
| | | 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 | 
July 20th, 2005, 06:54 PM
| | | Re: Linking to other web pages
"J. Christopher Miller" <the2nd3rd@earthlink.net> wrote in
news:M5H1c.18704$yZ1.519@newsread2.news.pas.earthl ink.net:
[color=blue]
> Hi,
>
> What's the difference between using <a href="/foldername/otherpage.html">
> (double quotes) and <a href='/foldername/otherpage.html'>(single quotes)?[/color]
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). | 
July 20th, 2005, 06:54 PM
| | | Re: Linking to other web pages
"Eric Bohlman" <ebohlman@earthlink.net> wrote in message
news:Xns94A258BA3B7Debohlmanomsdevcom@130.133.1.4. ..[color=blue]
> "J. Christopher Miller" <the2nd3rd@earthlink.net> wrote in
> news:M5H1c.18704$yZ1.519@newsread2.news.pas.earthl ink.net:
>[color=green]
> > Hi,
> >
> > What's the difference between using <a[/color][/color]
href="/foldername/otherpage.html">[color=blue][color=green]
> > (double quotes) and <a href='/foldername/otherpage.html'>(single[/color][/color]
quotes)?[color=blue]
>
> 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[/color]
.... though that's for sheer convenience, since you can also just substitute
an entity reference (") or a character code. | 
July 20th, 2005, 06:54 PM
| | | Re: Linking to other web pages
"Harlan Messinger" <h.messinger@comcast.net> schrieb im Newsbeitrag
news:c27gpg$1qctap$1@ID-114100.news.uni-berlin.de...[color=blue]
>
> "Eric Bohlman" <ebohlman@earthlink.net> wrote in message
> news:Xns94A258BA3B7Debohlmanomsdevcom@130.133.1.4. ..[color=green]
> > "J. Christopher Miller" <the2nd3rd@earthlink.net> wrote in
> > news:M5H1c.18704$yZ1.519@newsread2.news.pas.earthl ink.net:
> >[color=darkred]
> > > Hi,
> > >
> > > What's the difference between using <a[/color][/color]
> href="/foldername/otherpage.html">[color=green][color=darkred]
> > > (double quotes) and <a href='/foldername/otherpage.html'>(single[/color][/color]
> quotes)?[color=green]
> >
> > None whatsoever. You can use either type of quote around attribute[/color][/color]
values[color=blue][color=green]
> > (as long as both the opening and closing quote are the same type).[/color][/color]
That's[color=blue][color=green]
> > 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[/color]
>
> ... though that's for sheer convenience, since you can also just[/color]
substitute[color=blue]
> an entity reference (") or a character code.
>[/color]
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 | 
July 20th, 2005, 06:54 PM
| | | Re: Linking to other web pages
"Markus Ernst" <derernst@NO#SP#AMgmx.ch> wrote in message
news:40475495$0$17600$afc38c87@news.easynet.ch...[color=blue]
> "Harlan Messinger" <h.messinger@comcast.net> schrieb im Newsbeitrag
> news:c27gpg$1qctap$1@ID-114100.news.uni-berlin.de...[color=green]
> >
> > "Eric Bohlman" <ebohlman@earthlink.net> wrote in message
> > news:Xns94A258BA3B7Debohlmanomsdevcom@130.133.1.4. ..[color=darkred]
> > > "J. Christopher Miller" <the2nd3rd@earthlink.net> wrote in
> > > news:M5H1c.18704$yZ1.519@newsread2.news.pas.earthl ink.net:
> > >
> > > > Hi,
> > > >
> > > > What's the difference between using <a[/color]
> > href="/foldername/otherpage.html">[color=darkred]
> > > > (double quotes) and <a href='/foldername/otherpage.html'>(single[/color]
> > quotes)?[color=darkred]
> > >
> > > None whatsoever. You can use either type of quote around attribute[/color][/color]
> values[color=green][color=darkred]
> > > (as long as both the opening and closing quote are the same type).[/color][/color]
> That's[color=green][color=darkred]
> > > so that if, for some reason, the attribute value has to contain a[/color][/color][/color]
quote[color=blue][color=green][color=darkred]
> > > character of one type, you can use the other type to surround it[/color]
> >
> > ... though that's for sheer convenience, since you can also just[/color]
> substitute[color=green]
> > an entity reference (") or a character code.
> >[/color]
>
> Sometimes you need quotes inside attribute values, for example if you call[/color]
a[color=blue]
> 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[/color]
an[color=blue]
> issue of convenience.[/color]
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 ", and the second level as \", with the Javascript \ escape. | 
July 20th, 2005, 06:54 PM
| | | Re: Linking to other web pages
Eric Bohlman wrote:[color=blue]
> in HTML there are a few circumstances where you can omit the
> quotes, but they're not worth memorizing).[/color]
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... | 
July 20th, 2005, 06:54 PM
| | | Re: Linking to other web pages
Eric Bohlman wrote:
[color=blue][color=green]
>> in HTML there are a few circumstances where you can omit the
>> quotes, but they're not worth memorizing).[/color][/color]
"Keld R. Hansen" <news@www.heartware.dk> posted:
[color=blue]
> I have a very simple system...
>
> Quote alphanumeric values, leave numeric values unquoted.[/color]
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. | 
July 20th, 2005, 06:54 PM
| | | Re: Linking to other web pages
Tim <tim@mail.localhost.invalid> wrote:
[color=blue]
> So far as I'm aware, something like 45% has to be quoted, and
> that's a numerical value.[/color]
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.
[color=blue]
> My system is simpler; quote everything. ;-)[/color]
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 | 
July 20th, 2005, 06:54 PM
| | | Re: Linking to other web pages
Tim wrote:[color=blue][color=green]
>>I have a very simple system...
>>
>>Quote alphanumeric values, leave numeric values unquoted.
>>[/color]
> So far as I'm aware, something like 45% has to be quoted, and that's a
> numerical value.[/color]
"%" 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 :).
[color=blue]
> My system is simpler; quote everything. ;-)[/color]
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) | 
July 20th, 2005, 06:54 PM
| | | Re: Linking to other web pages
On Fri, 05 Mar 2004 10:25:16 +0100, "Keld R. Hansen"
<news@www.heartware.dk> wrote:
[color=blue]
>Eric Bohlman wrote:[color=green]
>> in HTML there are a few circumstances where you can omit the
>> quotes, but they're not worth memorizing).[/color]
>
>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...[/color]
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/ | 
July 20th, 2005, 06:55 PM
| | | Re: Linking to other web pages
Unattributed sources wrote:
[color=blue][color=green][color=darkred]
>>> I have a very simple system...
>>>
>>> Quote alphanumeric values, leave numeric values unquoted.[/color][/color][/color]
Tim wrote:
[color=blue][color=green]
>> So far as I'm aware, something like 45% has to be quoted, and that's a
>> numerical value.[/color][/color]
"Keld R. Hansen" <news@www.heartware.dk> posted:
[color=blue]
> "%" 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 :).[/color]
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.
[color=blue][color=green]
>> My system is simpler; quote everything. ;-)[/color][/color]
[color=blue]
> And waste a lot of bytes in the process :-).[/color]
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. | 
July 20th, 2005, 06:55 PM
| | | Re: Linking to other web pages
Tim wrote:[color=blue][color=green][color=darkred]
>>> So far as I'm aware, something like 45% has to be quoted, and that's a
>>> numerical value.
>>>[/color]
>> "%" 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 :).
>>[/color]
> 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). ;-)[/color]
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 |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over network members.
|