By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,453 Members | 956 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,453 IT Pros & Developers. It's quick & easy.

document.write question

P: n/a
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 ?
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
br*********@yahoo.com (brian) writes:
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?...&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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.