Results 1 to 4 of 4

Thread: Quotes in HTML string

  1. #1

    Thread Starter
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Quotes in HTML string

    Hi,
    We are in the process of rewritting several ASP scripts to make them browser insensitive. Most were written with IE in mind.
    The question of quotes came up. e.g.
    Code:
    <body bgcolor="#d0d0d0" text="#000000">
    <form name="call_work" method="post">
    <TABLE BORDER="1" CELLSPACING="5" width="100%">
    Etc...
    Questions:
    Will most browsers recognise a single quote in place of the regular quote?
    Which common browsers require quotes?
    Thanks,
    Al.
    A computer is a tool, not a toy.

  2. #2
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    Do to the nature of HTML/XML, you should be able to use single quotes or double quotes. The browsers should not care. But you should be consistent throughout the entire document. I believe it is best practice to use double quotes, as you will find the need to quote things within your quotes.

    Code:
    <tag attrib="value" onMethod="Function('value');">
    For the sake of arguement, check the W3C.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    last i read, XHTML standard dictates double quotes
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    XML also requires double quotes.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width