document.write question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • brian

    document.write question

    how does document.write interpret "" and '' (double quotes and single quotes)

    what is the significance of &Url (does it signify the current url)

    colon : is it represented as %3A ?
    and backslash represented as %2F ?
  • Lasse Reichstein Nielsen

    #2
    Re: document.write question

    brian_dell3@yah oo.com (brian) writes:
    [color=blue]
    > how does document.write interpret "" and '' (double quotes and single quotes)[/color]

    It doesn't. Document.write itself doesn't interpret anything. It just
    writes the contents of the string argument into the document stream so
    that the HTML interpreter will process it later.

    The argument is a string. If you want to add quotes to a string literal,
    you must escape the ones that match the ones around the literal. I.e.,
    if you want a string literal to contain:
    abc'def'ghi"jkl "mno
    you must write either
    "abc'def'ghi\"j kl\"mno"
    or
    'abc\'def\'ghi" jkl"mno'
    That is, you escape the quotes that would otherwise end the string.
    [color=blue]
    > what is the significance of &Url (does it signify the current url)[/color]

    It has no significance in itself. I looks like something that is used
    as part of an URL itself, e.g.

    [color=blue]
    > colon : is it represented as %3A ?
    > and backslash represented as %2F ?[/color]

    You can include both : and \ in string literals. If you want to use
    them as part of an URL string, you must escape them. In that case,
    they do become %3A and %5C. The character escaped as %2F is forward
    slash.

    My guess is that your document.write is used to write an URL. That URL
    contains several arguments after a question mark. Those arguments are
    separated by "&"'s, and one of them is called Url. The value of that
    argument is an URL which is encoded. Most likely something like
    &Url=http%3A%2F %2Fwww.example. com%2Fdims.html

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    Working...