Single or double quotes for HTML tags?

Results 1 to 3 of 3

Thread: Single or double quotes for HTML tags?

  1. #1
    Join Date
    Dec 1969
    Posts
    42

    Default Single or double quotes for HTML tags?

    Howdy. If I build a HTML page in a string and then response.write it to screen, how do I handle the double quotes (") for HTML tags? As far as I know I can&#039t add double quotes to the string. Can I use single quotes for all tags and will all browsers handle that? Other suggestions are welcome. Thanks!

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Single or double quotes for HTML tags?

    You can handle the double quotes like so: In every place you want a double quote, put two of &#039em! It will look funny, but will work.<BR><BR>So, if you want to write to the screen:<BR>&#060;A HREF="myPage.htm"&#062;My Page!&#060;/A&#062;<BR><BR>do:<BR><BR>Response.Write "&#060;A HREF=""myPage.htm""&#062;My Page!&#060;/A&#062;"<BR><BR>Note how I used two double quotes in place of all single double quotes in my HTML string.<BR><BR>Happy Programming!

  3. #3
    Join Date
    Dec 1969
    Posts
    2,493

    Default RE: Single or double quotes for HTML tags?

    Response.write "&#060;HTML&#062;" & vbcrlf<BR>Response.write "&#060;HEAD&#062;" & vbcrlf<BR>Response.write "&#060;TITLE&#062;MY TITLE&#060;/TITLE&#062;" & vbcrlf<BR>Response.write "&#060;/HEAD&#062;" & vbcrlf<BR>Response.write "&#060;BODY&#062;" & vbcrlf<BR>Response.write "&#060;p&#062;&#060;CENTER&#062;This is My Home Page&#060;/CENTER&#062;" & vbcrlf<BR>Response.write "&#060;/BODY&#062;" & vbcrlf<BR>Response.write "&#060;/HTML&#062;" & vbcrlf<BR>Response.End

Posting Permissions

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