document.write question

B

brian

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 ?
 
L

Lasse Reichstein Nielsen

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

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\"jkl\"mno"
or
'abc\'def\'ghi"jkl"mno'
That is, you escape the quotes that would otherwise end the string.
what is the significance of &Url (does it signify the current url)

It has no significance in itself. I looks like something that is used
as part of an URL itself, e.g.
http://www.example.com/request.html?type=foo&Url=dims.html
colon : is it represented as %3A ?
and backslash represented as %2F ?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top