Î
κÖлª
I want to create a multiline string that can works in ie and
firefox,
who have a better idea ?
firefox,
who have a better idea ?
I want to create a multiline string that can works in ie and
firefox,
who have a better idea ?
I want to define a multiline string.
like:
var html = "<html>
<body>
</body>
</html>
....
"
but i don't want to use '\'
I want to define a multiline string.
like:
<script language="javascript">var html = "<html>
<body>
</body>
</html>
....
"
I want to define a multiline string.
like:
var html = "<html>
<body>
</body>
</html>
....
"
but i don't want to use '\'
var html = "<html>" +
"<body>" +
"<\/body>" +
"<\/html>";
Douglas said:I want to define a multiline string.
[...]
but i don't want to use '\'
var html = "<html>" +
"<body>" +
"<\/body>" +
"<\/html>";
Peter said:Why escape the '/' on the closing tags? I have only read that is
necessary for script tags.
Do HTML parsers exist that have a problem with those closing tags
or are you just being conservative?
I find it a easier to use single quotes when quoting HTML because then
attribute double quotes don't need escaping.
"<li id=\"foo\">"
'<li id="foo">'
Douglas said:var html = "<html>" +
"<body>" +
"<\/body>" +
"<\/html>";
Steve said:Aha! If we can create a variable with a multiline string (using the OP's
nice description)
then I wonder if I can use it to set a TITLE attribute, and if the
resulting tooltip in Opera/Firefox will be multiline?
Thomas said:Add me. However, it is perfectly Valid to use apostrophes ("single quotes")
as attribute delimiter as well, even in X(HT)ML.
(Unfortunately, the SGML spec is not available free of charge at ISO.)
Thomas said:Your information is inaccurate.
CDATA content ends at an ETAGO delimiter,
no matter the element.
http://www.w3.org/TR/html4/types.html#type-cdata
Yes, the W3C Validator's SGML parser being one of them.
Maybe that as well.
It is not necessary to escape ETAGOs if they do not
occur within `script' element CDATA content.
<snip>So the said snippet has the
best chance to work everywhere.
Add me.
<snip>(Unfortunately, the SGML spec is not available free
of charge at ISO.)
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.