You are here: Re: [PHP] quoting values in HTML - is there a diference between ' and " « PHP « IT news, forums, messages
Re: [PHP] quoting values in HTML - is there a diference between ' and "

Posted by tg-php on 01/20/05 16:55

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация