Re: quoting values in HTML - is there a diference between ' and "
| From: | tg-php at gryffyndevelopment dot com | Date: | Thu, 20 Jan 2005 14:55:09 +0000 |
| Subject: | Re: quoting values in HTML - is there a diference between ' and " | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-206837@lists.php.net to get a copy of this message | ||
I believe HTML uses ' and " interchangeably. No real difference. Well, it also depends
on the HTML rendering engine too I guess. IE might do it ok but Firefox might not.. things like
that. But I think as far as the spec goes, you can use both. In a lot of cases, as long as there
are no spaces involved, you can go without the quotes too but that's just really poor coding
practice I think.
I believe they allow single and double quotes to help accomodate client side scripting languages
like JavaScript where you might have to echo text but still be able to break out to perform a
function or concatenate a variable or something. If a scripting language only let you use double
quotes, then you have the option of using single quotes in the HTML you're echoing. Or vice
versa.
Firefox's Web Developer extension (which I highly recommend for web developers) will tell you
if it's using W3 standard (strict), loose or...umm.. something else.. for it's rendering
of the web page. That is, if the HTML it's interpreting meets strict specs, loose specs, or is
just sloppy as crap but it's going to do what it can anyway... basically which facet of
it's rendering engine is being used to display the page.
-TG
= = = Original message = = =
I always thought quoting values in HTML had to be dome with double
quotes ("). however on reeding some stuff in the PHP manual the
examples use single quoted. Single quotes are allot more convenient
as I use double quotes generally for quoting strings. So are the two
totally synonymous in HTML?
Ben
--
Ben Edwards - Poole, UK, England
WARNING:This email contained partisan views - dont ever accuse me of
using the veneer of objectivity
If you have a problem emailing me use
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.