Response.write HTML

Results 1 to 3 of 3

Thread: Response.write HTML

  1. #1
    Join Date
    Dec 1969

    Default Response.write HTML

    I&#039d like to create a line of HTML on the fly by using Response.write, and write out a TD statement including a tag like: ... value="&#060;%=SomeStuff%&#062;".....<BR><BR>Obvio usly in the response.write the value tag wouldn&#039t have script delimiters. <BR><BR>Has anyone seen a decent example of the proper placement of ampersands and quotes / double quotes to concatonate this string? <BR><BR>Thanks,<BR>Thomas

  2. #2
    SPG Guest

    Default RE: Response.write HTML

    Very simple question.<BR><BR>SomeString = "something between quotes"<BR>Response.write SomeString<BR><BR>You can shorten that to something like<BR><BR>response.write "something between quotes"<BR><BR>and that makes sense, yes? But what if you *really* wanted it between quotes? Well, for reasons not entirely clear to most of the rest of the programming universe, VB/VBScript denote the literal rendering of a " to be "" -- hence,<BR><BR>response.write "something which ""claims"" to involve quotes"<BR><BR>would display quotes around the claims.<BR><BR>To toss another string into the middle of a string, just stop the quotes, insert the string, and start again.<BR><BR>Foo = " between "<BR>SomeString = "some words" & foo & "quotes"<BR><BR>Note that spaces are not inserted for you -- you have to have them attached to one string or the other if you really want them (which is good, since often times you won&#039t). Naturally, you can shorthand the above with a response.write...<BR><BR>response.write "some words" & foo & "quotes"<BR><BR>Putting all of this together (kind of abruptly, sorry)...<BR><BR>tdHeight = 15<BR>tdWidth = 18<BR>response.write "&#060;td width=""" & tdWidth & """ height=""" & tdHeight & """&#062;"<BR><BR>With the first two quotes after &#039width&#039 being output as one quote, the next quote stopping the string, the & attaching the &#039tdWidth&#039 value, the & and " starting the string and the next two quotes being output as one quote. Repeat this pattern for the height. Reread as necessary.<BR><BR>Got it? ;-)

  3. #3
    Join Date
    Dec 1969
    Los Angeles, CA

    Default This guy has patience

    Man i am impressed someone took the time to type all that he did. Keep it up man i hope you have the answer to the question i post the next time and it is in as much detail

Posting Permissions

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